-->
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: Weird problem with flushing and UserType in Hibernate 3.2.1
PostPosted: Thu Jan 18, 2007 6:41 am 
Newbie

Joined: Wed Nov 08, 2006 4:16 pm
Posts: 4
Hibernate version: 3.2.1

We're running a Spring-based web application that uses Hibernate with Spring transaction management.

So far, everything worked fine, but after we updated our Hibernate version from 3.2.0 to 3.2.1, a weird bug was introduced, and certain changes to objects weren't persisted anymore.

Inside a transaction, we iterate over a number of Job objects that change certain model objects' properties, including a UserType we wrote for convienience. After each iteration, we call flush() on Spring's HibernateTemplate in order to prevent rare cases of inconsistencies that occured when two jobs handled the same object operations, thereby flushing the Hibernate session. We can see in the log files that our UserType's nullSafeSet() method is called at this point.

With Hibernate 3.2.0, all changes were persisted after each flush() call and at the end of the transaction.

With Hibernate 3.2.1, only the changes up to the first flush() call are persisted, and everything that occurs in the other iterations is not persisted at all! We can see in the log files that the flush() method is correctly called, but the UserType's nullSafeSet() isn't.

If we omit the flush() calls, all changes are persisted correctly at the end of the transaction, but we need those calls to prevent the possibility of a rare bug in our application.

I browsed the changelogs, but I couldn't find a reason why Hibernate behaves differently in this setup after the update to 3.2.1.

Any suggestions would be highly appreciated. Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 6:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
write a (minimal) testcase that shows the problem and report it as a bug in jira.

_________________
Max
Don't forget to rate


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.