| Summary: | Process instance is active though the transaction rollback was performed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Ivo Bek <ibek> | ||||
| Component: | jBPM Core | Assignee: | Maciej Swiderski <mswiders> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Ivo Bek <ibek> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.0.0 | ||||||
| Target Milestone: | ER4 | ||||||
| Target Release: | 6.0.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-09-12 08:38:57 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
Ivo Bek
2013-09-11 14:24:44 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)
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?
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.
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? Then I have no idea how it appeared there :). Yes, we can close it since there is nothing to be fixed. |