-->
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.  [ 2 posts ] 
Author Message
 Post subject: Will cached objects clean up after session.close()?
PostPosted: Tue Oct 10, 2006 5:21 pm 
Newbie

Joined: Fri Mar 11, 2005 5:36 pm
Posts: 10
Hibernate version:2.1.8

It seems the standard query cache is always available even after session.close(), but not when selecting the entire object

for example, if we are selecting the table using

List l = createQuery("select a.col1,a.col2 from tableA a").list();

the cache collection will not be clean.

However

TableAData aa = createQuery(" from tableA");

The cache object will be gone from session.close

Am I missing something obvious?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 10, 2006 9:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hibernate has a multi-level caching architecture.
1) Session cache
2) Secondary Cache - normally defined using ehcache.

The secondary cache data normally outlives any individual session.
There are two caching uses for the sescond level cache
1) Individual object data. (Note: Stored in the cache as a set of data rather than a full object).
2) A query result set. (Note: It stores sets of Individual data as in (1) Above and has a timestamp control mechanism.

In my view and experience you will find good benefits from selective use of second level cache for individual objects (using session.get or load etc) and less opporunities for benefits from the query cache.


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

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.