-->
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: Collection cache not being evicted properly
PostPosted: Mon Sep 26, 2011 12:15 pm 
Newbie

Joined: Tue Nov 09, 2010 4:42 pm
Posts: 7
I'm having an issue with Hibernate Cache as it relates to collections.

I have an entity, which is cached. The entity has a collection, and the collection is also cached. The entity on the other side of the collection, likewise, is cached.

The issue arises when I try to add an object to the collection. I make sure to add the relationship on both sides. That is, I add the child, persist it, and then add the child to the parent's collection. Hibernate logs a "pre-invalidating" and "invalidating" message on the relationship's table.

However, if I reload the parent entity, the child is not in the collection. If I restart the server to clear the cache, the child will be in the collection as expected.

The issue occurs on a delete, as well. That is, the child will still be in the collection after reloading the entity, although it is no longer in the database.

Removing caching on the collection OR on the parent itself will cause the issue to go away.

What might be causing this problem?


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.