-->
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.  [ 3 posts ] 
Author Message
 Post subject: Session cache - why not store only dirty objects?
PostPosted: Fri Dec 02, 2005 3:23 am 
Newbie

Joined: Fri Apr 02, 2004 9:57 am
Posts: 14
Hello,

I read in the docs in section 12.1.4 (http://www.hibernate.org/hib_docs/v3/reference/en/html/transactions.html) that the session stores all persistent objects - which means the objects returned by queries.
I feel this a problem in case of the session-per-application-transaction pattern as well because the session can grow very large.

My q.: why not create a method in Session which discards non-dirty objects from its cache? Am I misunderstood something?

Regards,
Norbi


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 3:34 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
because those non-dirty objects may be referenced by dirty objects . when the session is flushed, you would get a pretty stack trace along the lines of "object references null or tranisent value".


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 3:36 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
use Session.clear or Session.evict if you have memory probs


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.