-->
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: Rollback and Entity Transaction
PostPosted: Fri May 30, 2008 3:14 am 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Hi,

Is is good enough to just checking if an entity transaction is not equal to null in order to determine whether to rollback the entity transaction or not?

Reason being sometimes when I try to rollback, the et.rollback() throws exception of "Transaction is not active". So, I would like to avoid it.

Code:
if (et != null) {
            log.debug("Rolling back database transaction of this thread.");
            et.rollback();
} catch (Exception ex) {
            throw new InfrastructureException(ex);
}


Please advise.

_________________
Thank you.

Regards,
Jap.


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.