Bug 771208 - TaskException getting buried by a transaction rollback exception
Summary: TaskException getting buried by a transaction rollback exception
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM 5
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Kris Verlaenen
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-02 13:44 UTC by Jeffrey Bride
Modified: 2012-04-04 21:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-04 21:01:15 UTC
Type: ---


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.