Hi,
my question is quite simple, I want to use the EHCache for all my queries. I dont want to go to the database for a particuliar object.
I have set the EHCache correctly I guess (in the hbm.xml and cgf.xml and ehcache.xml).
First, I try to fill the cache of all "objectToCaches" by this request :
Code:
Query query2 = session.createQuery("from objectToCache gn");
List cmlist2 = query.list();
logger.debug("SIZE objectToCache:" + cmlist2.size());
And if I do this :
Code:
ObjectToCache objectToCache = (ObjectToCache )sessionAS400.load(ObjectToCache .class, ANYRECORD);
I want Hibernate to read the cache instead of query the database.
I see this query in the log :
Code:
"Hibernate: select gnocptj1x0_.CPCPT as CPCPT0_, gnocptj1x0_.ordivi as ordivi7_0_ from VMDPRDTA.GNOCPTJ1 gnocptj1x0_ where gnocptj1x0_.CPCPT=?"
that indicate that the record is load... from a unique select and not retreive in the cache.
Is there some place I need to put >> lazy="false" << ??
Thanks.
Etienne
Montreal