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