Bug 779499 (SOA-1882)

Summary: ExecuteJobCommand in ESB's jBPM integration doesn't roll back the transaction even if the action handler throws Exception
Product: [JBoss] JBoss Enterprise SOA Platform 4 Reporter: Toshiya Kobayashi <tkobayas>
Component: JBPM - within SOAAssignee: Kevin Conner <kevin.conner>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.3 CP02CC: bernd.ruecker, dlesage
Target Milestone: ---   
Target Release: 4.3 CP04 ER1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-1882
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-25 11:11:33 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Deadline: 2010-03-08   
Attachments:
Description Flags
jobexecution.zip none

Description Toshiya Kobayashi 2010-01-26 01:10:06 UTC
Date of First Response: 2010-01-26 01:52:43
Help Desk Ticket Reference: https://enterprise.redhat.com/issue-tracker/379428
Workaround: Workaround Exists
Workaround Description: Call JbpmContext.setRollbackOnly() in the action handler.
Note: This workaround is hitting SOA-1881 at this moment. It causes rollback but shows messy Error log.
project_key: SOA

In case that Job execution of an async node is processed by JCA inflow messaging service (SOA-P integration), the transaction is not rolled back even if the action handler throws Exception/RuntimeException. The transaction is commtted and then org.jboss.soa.esb.services.jbpm.integration.job.ExecuteJobCommand.executeJob() kicks one retry which would lead to duplicate commit.

It looks inconsistent with docs:
http://www.redhat.com/docs/en-US/JBoss_SOA_Platform/4.3.CP02/html-single/JBPM_Reference_Manual/index.html#jbpmsbuiltinasynchronousmessaging
============
If execution of a command message fails, the transaction will be rolled back. After that, a new transaction will be started that adds the error message to the message in the database. The command executor filters out all messages that contain an exception.
============

I've attatched a reproducer.
- unzip jobexecution.zip
- modify build.properties
- ant deploypar
- ant deploy
- ant ejbclient (or access jbpm-console to start process instance)
- access jbpm-console to check process instance's id which is created by the action handler (which should be rolled back)

Comment 1 Toshiya Kobayashi 2010-01-26 01:26:40 UTC
Attachment: Added: jobexecution.zip


Comment 3 Toshiya Kobayashi 2010-01-26 01:55:41 UTC
Link: Added: This issue is related to SOA-1880


Comment 4 Toshiya Kobayashi 2010-01-26 01:56:26 UTC
Link: Added: This issue related SOA-1881


Comment 5 Toshiya Kobayashi 2010-01-26 02:33:45 UTC
Link: Added: This issue incorporates JBESB-3152


Comment 6 Kevin Conner 2010-01-26 06:52:43 UTC
ESB issue has been rejected as we duplicate the jBPM behaviour.

Comment 7 Kevin Conner 2010-01-26 06:53:25 UTC
Sorry, didn't mean to close this one

Comment 8 Kevin Conner 2010-01-26 06:53:50 UTC
Changed to a feature request

Comment 9 Toshiya Kobayashi 2010-01-26 09:31:04 UTC
added 5.0.0.ER7 as affects version

Comment 10 Kevin Conner 2010-01-27 13:37:11 UTC
Link: Added: This issue related SOA-1889


Comment 11 Alejandro Guizar 2010-01-27 21:43:07 UTC
As proposed over email, I would like that that the changes made in the ExecuteJobCommand from the jBPM
enterprise module under JBPM-2691 be adapted to the JCA inflow messaging service.

Comment 12 Kevin Conner 2010-01-28 09:39:32 UTC
As previously stated in email, we are implementing our own version and deviating from the jBPM behaviour.  This deviation is to be documented.

Comment 13 Anne-Louise Tangring 2010-02-25 19:42:49 UTC
Approved for SOA 4.3 CP03. Please make sure it gets assigned to the appropriate person.

Comment 14 Kevin Conner 2010-03-04 12:55:36 UTC
Link: Removed: This issue incorporates JBESB-3152 


Comment 15 Kevin Conner 2010-03-04 12:55:54 UTC
Link: Added: This issue depends JBESB-3152


Comment 16 Kevin Conner 2010-03-04 20:27:59 UTC
Updated in ESB codebase, will be in next merge.

Comment 17 David Le Sage 2010-03-10 01:10:36 UTC
Draft text for Resolved Issues section of Release Notes states:


https://jira.jboss.org/jira/browse/JBESB-3152

    If an async node was executed via the Enterprise Service Bus' JCA Inflow
    Message Service, the transaction was not being rolled back even if the action
    handler generated an exception. The transaction would be committed and then the
    org.jboss.soa.esb.services.jbpm.integration.job.ExecuteJobCommand.executeJob()
    method would try to process it again, leading to a duplicate commitment.

    To rectify this issue, custom changes have been made to ExecuteJobCommand so that this
    problem with JCA Inflow Messaging no longer occurs.

    Note

    This means that there is now a deviation between the behavior of the version of
    ExecuteJobCommand used by jBPM and that used by the ESB.


Comment 18 Marek Baluch 2010-03-25 11:11:33 UTC
Verified on 4.3 CP03.

The transaction is rolled back and the created process instance from the action which threw the Exception is not there anymore.