-->
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.  [ 4 posts ] 
Author Message
 Post subject: TransactionHelper tm.resume() problem in finally block
PostPosted: Tue Mar 22, 2005 2:54 am 
Regular
Regular

Joined: Tue Mar 22, 2005 2:27 am
Posts: 62
Hibernate version: 3.0rc1
JOTM: 2.0.5

Hi All,

I have an ID generator running within a JTA environment using the JOTM TransactionManager.
Subsequent to doWorkInCurrentTransaction() failing with an SQLException (due to a silly DB setup error on my part, but not the issue), the finally block attempts to resume the originally suspended transaction which is causing JOTM to throw a JTA exception on tm.resume().
The transaction on which the SQLException occurred is still in play (and bound to the current thread of execution) because the error handling code in org.hibernate.engine.TransactionHelper didn't commit it or roll it back.
Also, it should be noted that this JTA exception is effectively masking the original SQLException thereby making the cause difficult to ascertain without stepping through with a debugger.

My question is:
should tm.rollback() be called in the event of an SQLException being thrown by doWorkInCurrentTransaction()?

Let me know if more details are needed...
Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 12:54 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you mean that JOTM can't resume a tx context if the second tx is neither commited or rollbacked. Is it correct?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 27, 2005 11:20 pm 
Regular
Regular

Joined: Tue Mar 22, 2005 2:27 am
Posts: 62
Yes, that appears to be exactly what is happening.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 5:28 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
OK, I've patched it in my box. I'll be applied soon.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.