These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: EHCache loading initialization
PostPosted: Fri Mar 11, 2005 6:04 pm 
Senior
Senior

Joined: Tue Jan 11, 2005 5:03 pm
Posts: 137
Location: Montreal, Quebec
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.