Open emmanuelbernard opened 14 years ago
Yes, I have this in place. Start any Infinispan test with -Dinfinispan.test.jta.tm=jbosstm and the test uses JBoss TS Standalone. Otherwise it uses an internal DummyTransactionManager stub.
Have a look at TransactionSetup, a test helper class that handles this.
http://fisheye.jboss.org/browse/Infinispan/branches/4.1.x/core/src/test/java/org/infinispan/test/fwk/TransactionSetup.java?r=2041#l36
This is used by the TestCacheManagerFactory which creates configurations and cache managers for the unit tests, injecting the appropriate transaction manager based on the system property.
http://fisheye.jboss.org/browse/Infinispan/branches/4.1.x/core/src/test/java/org/infinispan/test/fwk/TestCacheManagerFactory.java?r=2276#l110
emmanuel>About JTA, it's more an Infinispan's business. I am just using the cache. If somebody tells me how to configure JTA in Infinispan + a standalone JTA TM, I can add a unit test for this.
manik>Just make sure your Infinispan configuration uses a TransactionManagerLookup. For JBoss TS standalone, make sure you use JBossStandaloneJTAManagerLookup. E.g.,
or if you are using an XML file to configure,
emmanuel>Note that I have JBoss TS standalone working in HSearch but the resource registration relies on SQL Datasource, not just any XAResource.
manik>Hmm. Maybe adding a UT would be a good idea, to flush out any nuances here.