-->
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: VERY weird behaviour in Hibernate's PersistentCollection.
PostPosted: Mon Jan 16, 2006 7:49 am 
Good day everybody.

[b]Hibernate version:3.05

I'm facing a weird behaviour in Hibernate's dettached and reattached objects that are kept inside a PersistentCollection.
I have a graph of Objects that are dettached from the hibernate session. When I reassociate it in the next request everything goes Ok.
I delete or update or even insert some objects in the graph and see no problem with that.
BUT, in the second time i try to manipulate Objects in the same graph (second request that came from the same page) I CANNOT delete elements by REMOVING them from the Hibernate's PersistentCollection.
By no means my PersistentCollection removes the elements.
I have this excerpt of code: Have a look:

Iterator itValues = middlewareValuesAux.iterator();
while(itValues.hasNext()){
Object o = itValues.next();
if( !dynaFormValues.contains(o) ){

boolean removed = middlewareValues.remove(o);
if( ! removed ){
System.out.println("Can't remove from the LIST...");
}
else......blablabla

In the code above the System.out is ALWAYS PRINTED if I'am in the second request that manipulates the same PersistentCollection...

How come? My equals and hashCode are fine. Collection's contains works fine but PersistentCollection's remove doesn't.

I'd appreciate any help!!

Cheers,

:Luiz.


Top
  
 
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.