-->
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: Removing Object from PersistentSet: NOT a hashCode problem!
PostPosted: Thu Mar 12, 2009 5:29 pm 
Newbie

Joined: Thu Nov 16, 2006 11:52 am
Posts: 8
Location: Frankfurt a.M., Germany
Hello,

I have a problem with removing an object from a 1:n relation from a PersistentSet. Removing the object works fine when done through the running application. However, the object is not removed when exactly the same code is executed initiated through a JUnit test case with exactly the same data.

I'm sure it is not the usual problem of the hashCode method not being written propperly. I iterate over the PersistentSet and write the hash code of every object in the set to the console and I see that the hashCode of the object to be removed is included in the set. Once more, it only happens when initiated through a JUnit test case. It does not happen when the code is run through the running application. In both cases exactly the same CSV file is parsed and imported.

I'm using hibernate 3.2.6 with annotations and Spring with annotations. The JUnit4 test case use annotations as well (@Transactional combined with defaultRollback = false). The called method that imports the CSV file is annotated with @Transactional(propagation = Propagations.REQUIRED).

Maybe someone has an idea where to start looking for the problem. Have tried some things but have remained basically without a clue.

Thanks and regards,
Oliver


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.