-->
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: StaleObjectStateException after tx-rollback in jboss
PostPosted: Thu Sep 25, 2003 11:54 am 
Beginner
Beginner

Joined: Tue Sep 16, 2003 11:26 am
Posts: 25
Location: Berlin - Germany
hi,

we use hibernate 2 with jboss datasources.
if there is a foreign-key conflict in the database while deleting some db-entries, jboss rolls back the transaction.
in our application i put session.delete(query) in a try and session.flush() in a finally block.

after rollback i get a StaleObjectStateException in session.flush().
can you help me to prevend this?

greetings from berlin, daniel.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 10:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The flush should not be in a finally block. flush() is what synchronizes the hibernate state with the db. After an exception, the session should no longer be used for anything other than closing it.


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.