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
|