-->
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: Flush on Entity with Collection invalidates query results
PostPosted: Wed Feb 21, 2007 6:54 pm 
Newbie

Joined: Tue Feb 20, 2007 12:01 pm
Posts: 6
I find this pretty confusing, but I think this is going on:
1) I use a query to get an object A.
2) Object A has a collection of B's.
3) I use a different query to get a collection B's. This query is setup for caching.
4) I repeat step 3), expecting to get back the cached query results. But I don't. I took a look and think the problem is that when my query in step 4 executes, a Flush occurs. Now this Flush checks the "removeCollections" and for some reason the collection of B's on my A object is causing an invalidation to the query cache for the B's table. Well I have not changed the collection of B's on the A, so i don't see why the B's are getting invalidated. It seems just by virtue of there being a Persister on the collection, invalidation occurs.

Does this scenario seem plausible? I switched to using a readonly cache for the collection of B's on the A, and then got an exception. But nothing is modifying this collection so why would that occur?

Thanks,

JP


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 2:49 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Apparently NHibernate thinks that something changed in that collection of B's or maybe it got detached from A somehow. How do property accessors in A look like? Also try to enable debug logging, there should be some hint in the logs as to what NHibernate thinks has changed.


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.