Bug 771208

Summary: TaskException getting buried by a transaction rollback exception
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jeffrey Bride <jbride2001>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: CLOSED WORKSFORME QA Contact: Lukáš Petrovický <lpetrovi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: brms-jira
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-04 21:01:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jeffrey Bride 2012-01-02 13:44:59 UTC
problem :
TaskServiceSession.taskOperation() catches RuntimeException and if transactionType == local-JTA, sets the UserTransaction to Status.MARKED_ROLLBACK.  However, in the finally block, a ut.commit() is currently ALWAYS invoked.  Attempting to commit on a trnx marked for rollback is an illegal operation.  Subsequently, the original RuntimException is overwritten by a new RuntimeException as follows (in a bitronix environment .... a similar runtime exception is thrown by arjuna in JBoss) :

java.lang.RuntimeException: bitronix.tm.internal.BitronixRollbackException: transaction was marked as rollback only and has been rolled back




solution :
modify the finally block in TaskServiceSession.taskOperation() :

446 if (transactionStarted) {
447     try {
448         UserTransaction ut = (UserTransaction)new InitialContext().lookup( "java:comp/UserTransaction" );
449         if(ut.getStatus() !=javax.transaction.Status.STATUS_MARKED_ROLLBACK)
450             ut.commit();
451     } catch (Exception e) {
452         throw new RuntimeException(e);
453     }       
454 }

Comment 1 Kris Verlaenen 2012-01-27 15:07:02 UTC
Fixed in community, should be available in next build.

Comment 2 Jeffrey Bride 2012-04-04 21:01:15 UTC
verified this has been fixed.  thanks kris.  closing bug