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: How to abort transaction in BeforeTransactionCompletion?
PostPosted: Fri Jul 27, 2007 1:27 pm 
Beginner
Beginner

Joined: Thu May 31, 2007 1:19 pm
Posts: 23
Hi

My interceptor runs code that relies on an external process that could be in an invalid state.

I would like to be able to stop a transaction from committing in this case.

The problem is that if I raise an exception, in BeforeTransactionCompletion, the Session just logs it and swallows it and then commits the transaction anyway.

I think if BeforeTransactionCompletion throws an exception, the transaction should not be comitted.

Anyone have any ideas for a workaround?
Mark


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 27, 2007 2:38 pm 
Beginner
Beginner

Joined: Thu May 31, 2007 1:19 pm
Posts: 23
Well, it seems that if I throw on Pre or Post Flush, the transaction is aborted, Pre and Post are not called on a rollback.


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.