-->
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: session.load confusion
PostPosted: Tue Dec 04, 2007 7:45 am 
Newbie

Joined: Tue Nov 27, 2007 7:53 am
Posts: 5
I have some doubts regarding session.load.plz help me in resolving them.

According to the api it works as
First, an attempt is
made to load the entity from the session-level cache. If not found there, an attempt is made to locate it in second-level cache. Lastly, an attempt is made to load it directly from the datasource


Now I have my code as


//open session

//fire a query which returns all obejcts of Class Country.

//do not close the session.


//do session.load to get a COuntry iobject with id as 1


this works fine



but if i do some thing like this
//open session

//fire a query which returns all obejcts of Class Country.

// close the session.

//open new session


//do session.load to get a COuntry iobject with id as 1


It goes to the db instead of checking 2nd level cache


Kindly help.

my second level cache is enabled as I have checked the logs properly


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.