-->
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: Undesired Collection Eviction
PostPosted: Sat Jan 28, 2006 10:47 am 
Newbie

Joined: Sat Jan 28, 2006 10:29 am
Posts: 1
Hibernate version: hibernate 2.1.8

I am having a performance problem I am attempting to resolve with the secondary cache. The secondary cache for my collections is being used if I do the proper pre-fetch, and works wonderfully!! (ie. "left join fetch"). My problem is occurring outside of read scope after bulk inserts and/or updates. I do a bunch of object creates and relates (requiring collection insertions and/or updates), and this works great.

My session is closed, and then another is reopened. I have detached objects that reattach to the session, and then my problem occurs. All of my collections, which are newly generated, start needing to be retrieved from the database. Performance suffers greatly.

I've been digging into hibernate code and understand the where this is happening, and I even understand some of the why, after reading messages on this forum. Gavin stated, without explanation on the threads I read (admittedly, I only dug for an hour, but I did look hard for that hour!), that collections are intentionally evicted from the cache.

I believe this is probably the correct behavior for the general case. However, I desire more control for our application's case. How do I attain this control? I wish to have newly insert-ed and/or update-ed collections remain in the secondary cache.

Aside from writing my own cache implementation and ignoring the semantics of "evict" "lock" and "release", i'm at a loss as to where to go next. I would gladly implement any custom code that can help control this behavior--I'm not sure where that would be.

Specifically, I see that for entities special code is in place to determine what is able to be retained, based on version and other heuristics. None of that is available for collections.

Thanks for any help in advance and thanks for the great product.


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.