Bug 1006940 - Process instance is active though the transaction rollback was performed
Summary: Process instance is active though the transaction rollback was performed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER4
: 6.0.0
Assignee: Maciej Swiderski
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-11 14:24 UTC by Ivo Bek
Modified: 2013-09-12 08:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-12 08:38:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
StartProcessRollbackTest (2.08 KB, text/x-java)
2013-09-11 14:40 UTC, Ivo Bek
no flags Details

Description Ivo Bek 2013-09-11 14:24:44 UTC
Description of problem:

Seems the start of process is not persisted because if I perform the steps below, the process instance is still active in ksession.

#begin of transaction
#start of process
#rollback
#dispose runtime manager
#create runtime manager with the same identifier to reload the persisted ksession (BTW strategy is SINGLETON)
#get process instance
#check that the process instance is null -- here is the problem because the process instance isn't null


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ivo Bek 2013-09-11 14:40:07 UTC
Created attachment 796426 [details]
StartProcessRollbackTest

Attached StartProcessRollbackTest. The test uses JbpmJUnitBaseTestCase, so you should be able to test it in jbpm-test module or somewhere you have access to the module. Also use any process definition which stay active after start (e.g. containing a human task)

Comment 2 Maciej Swiderski 2013-09-11 15:36:27 UTC
the reason why the process instance is not rolled back as expected is due to user transaction instance is not the right one:

UserTransaction ut = com.arjuna.ats.jta.UserTransaction.userTransaction();

arjuna transaction is not used in junit testing and thus it will give instance that is not used by the runtime service. With that said even though you call rollback the engine when executing process isntance does not find any active transaction and thus commit it on the end of startProcess operation. To make your test work properly you should replace the line above with:

UserTransaction ut = InitialContext.doLookup("java:comp/UserTransaction");

could you please confirm?

Comment 3 Ivo Bek 2013-09-12 07:50:56 UTC
Hi Maciej,

thank you, I recycled the tests for transactions from BRMS 5.x, so has this changed meantime? After the change to use InitialContext.doLookup("java:comp/UserTransaction"); the test works.

Comment 4 Maciej Swiderski 2013-09-12 08:34:23 UTC
Ivo, thanks for confirmation. 

As far as I can tell, nothing has changed in this regard. JUnit tests were always relying on UserTransaction taken from JNDI and never used arjuna for any sort of transaction operations. bitronix is used in tests and it does bind UserTransaction into JNDI.

I believe then this issue can be closed, wdyt?

Comment 5 Ivo Bek 2013-09-12 08:38:57 UTC
Then I have no idea how it appeared there :). Yes, we can close it since there is nothing to be fixed.


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