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: Contents of lazy-loaded collection
PostPosted: Tue Nov 21, 2006 6:04 pm 
Beginner
Beginner

Joined: Fri May 06, 2005 2:37 pm
Posts: 39
Hibernate 3.2.1

I'm rolling through a collection that has been lazy loaded, calling equals() on all the objects to try and find one, and I'm getting inconsistent results.

For some reason, the contents of the collection are mixed between non-proxied and proxied objects. This makes my equals() calls fail when they are called on a proxied object.

It seems that the objects that remain proxies vary, and sometimes no objects are proxied. I have no idea why I get this inconsistent behavior, however. What would cause a collection to be populated by such a mixture?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 10:43 pm 
Beginner
Beginner

Joined: Fri May 06, 2005 2:37 pm
Posts: 39
To follow up, it looks like the problem is I had a collection, with a size greater than my fetch size. I was also pulling objects that belonged to the collection through another relationship, which ended up as proxies. The collection then pulled those proxies from the session cache when it got to them.

So, lesson is, if you're getting objects from two different sources in the same transaction, you might end up with proxy conflicts.


Top
 Profile  
 
 Post subject: Should not matter
PostPosted: Wed Nov 22, 2006 8:21 pm 
Newbie

Joined: Mon Oct 24, 2005 6:34 pm
Posts: 14
Location: Guadalajara, Jalisco. México.
Hibernate should be able to manage both proxied and non-proxied objects transparently from wherever they came from. There sould be somethig else.


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.