Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.1.7c
final AbstractCacheCommand c= new AbstractCacheCommand(session,CacheUtils.getTaskDefCache()){
protected CachebleBo getNewObject(Serializable[] key) throws ApplicationException {
try {
final Example example = Example.create(bo);
final Criteria createCriteria = createCriteria(TaskDefBo.class);
final Criteria add = createCriteria.add(example);
add.setCacheable(true);
add.setCacheRegion(TaskDefBo.class.getName());
CachebleList cachebleList=new CachebleList(add.list());
return cachebleList;
} catch (HibernateException e) {
throw new ApplicationException("Error getting TaskDefBo by filter definition");
}
}
};
Name and version of the database you are using: oracle 10g
hi all, i'm using the code above as my own cache management, the AbstractCacheCommand, simply gets a key checks to see if it exists in the cahce otherwise ith executes the code in the callback method.
but i don't want to do that, i want hibernate to do it for me, but for some reasons it's much slower then my own implementation, maybe becouse it's a flush in the session when i do the list method.
i'm using ehcache 1.2.3
for reasons i won't go into, i'm using the ehcache.xml in it's default configuration, meaning the each class gets it's region from the default settings, does that matter? i'm doing the same with my cache.