[英]Ehcache simple search/transaction example?
我正在嘗試測試ehcache的功能,我相信我已經在從代碼示例和其他在線地方學到的緩存初始化中正確設置了它。 但是,盡管無論哪個屬性,我都不知道如何成功進行搜索,但是我還沒有添加搜索屬性。 我希望看到一個使用任何屬性進行搜索的簡單示例。 同樣,我也不知道如何使用ehcache的事務處理功能,因此我也希望找到一個簡單的示例。
private static CacheManager cacheManager;
private static Ehcache ehcache;
private TransactionController transactionController;
public void initCache() throws Exception {
Configuration managerConfigur = new Configuration();
CacheConfiguration cacheConfigur = new CacheConfiguration("testcache1",-1).eternal(true);
Searchable searchable = new Searchable();
cacheConfigur.addSearchable(searchable);
//Set attributes for search here
cacheConfigur.transactionalMode(TransactionalMode.LOCAL);
managerConfigur.addCache(cacheConfigur);
cacheManager = new CacheManager(managerConfigur);
ehcache = manager.getEhcache("testCache");
}
謝謝
嗯...我知道“您嘗試過Google”會很粗魯,但是...您嘗試過嗎? :)
具體來說,您是否看過
似乎“簡單的示例”已具備您所需的一切,並且提供了交易入門視頻 ...如果您在此之后還有其他疑問,請告訴我們您正在尋找什么。 希望有幫助:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.