Bug 1032932

Summary: TransactionMixIn misconfigures TransactionSynchronizationRegistry
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Daniel Tschan, Puzzle ITC <tschan+redhat>
Component: SwitchYardAssignee: Tomohisa Igarashi <toigaras>
Status: MODIFIED --- QA Contact: Matej Melko <mmelko>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: jcordes, ldimaggi, serviceworks, soa-p-jira, tschan+redhat
Target Milestone: DR1   
Target Release: 6.1.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The TransactionMixIn class does not configure the JTAEnvironmentBean used by the TransactionSynchronizationRegistry. Instead, it registers in JNDI. As soon as you use TransactionSynchronizationRegistry directly or indirectly an exception is thrown. As a workaround, you will find a proposed patch attached to the bug ticket.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Unit test demonstrating the problem.
none
Proposed patch for the issue. none

Description Daniel Tschan, Puzzle ITC 2013-11-21 09:26:46 UTC
Created attachment 827091 [details]
Unit test demonstrating the problem.

Description of problem:
The TransactionMixIn class doesn't configure the JTAEnvironmentBean used by the TransactionSynchronizationRegistry it registers in JNDI. As soon as the TransactionSynchronizationRegistry is used directly or indirectly an exception is thrown and the test is aborted.


Version-Release number of selected component (if applicable):
JBoss Fuse Service Works 6.0.0 Beta

How reproducible:
Always, see attached unit test.

Steps to Reproduce:
1. Run attached unit test.
2.
3.

Actual results:

Test aborts with:
com.arjuna.ats.arjuna.exceptions.FatalError
	at com.arjuna.ats.internal.jts.ORBManager.getPOA(ORBManager.java:87)
	at com.arjuna.ats.internal.jts.OTSImpleManager.<clinit>(OTSImpleManager.java:296)
	at com.arjuna.ats.internal.jta.transaction.jts.TransactionImple.getTransaction(TransactionImple.java:1126)
	at com.arjuna.ats.internal.jta.transaction.jts.BaseTransaction.getStatus(BaseTransaction.java:195)
	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple.getTransactionStatus(TransactionSynchronizationRegistryImple.java:161)
	at ch.bls.schub.infrastructure.persistence.TransactionSynchronizationRegistryTest.testTransactionSynchronizationRegistry(TransactionSynchronizationRegistryTest.java:21)


additionally the following error is logged:

09:55:10,443 FATAL [com.arjuna.ats.jts] ARJUNA022006: The ORB has not been initialized yet



Expected results:
TransactionSynchronizationRegistry works as described by JTA spec.

Additional info:
Proposed patch to follow.

Comment 2 Daniel Tschan, Puzzle ITC 2013-11-21 11:44:24 UTC
Created attachment 827153 [details]
Proposed patch for the issue.

Comment 3 Keith Babo 2013-11-21 15:14:21 UTC
Thanks for reporting the issue and the providing a patch.  Tomo - can you have a look at this?

Setting devel ack to '-' due to the fact that this is not a blocker for 6.0.

Comment 4 Tomohisa Igarashi 2013-11-22 10:18:05 UTC
Confirmed the problem and the suggested fix avoid it. A pull request is linked to SWITCHYARD-1860 so we can merge it. Thanks for the report, tschan!