In a utility class I am starting a user transaction which contains an XA datasource(9i) and an XA enabled TCF. On the utx.begin() method there is an error thrown saying : java.lang.IllegalStateException: Cannot start a global transaction. A LocalTransactionContainment is already active with work. This method of the utility class is being called by a stateless session bean which is deployed using BMT demarcation and there is no utx used there. Further in the exception trace a 'java.sql.SQLException: Use explicit XA call' message is also printed. How to overcome this and make it work.
WAS likes to manage its own transactions and doesn't like you to interfere. It is possible for you to hook into the WAS transaction management to simulate this though. I have the code to demonstrate this at work, but I don't have it available over the weekend. Its based on this code which demonstrates wraping the WebSphere transaction management to implement the TransactionManager interface. The sample is used in Castor since Castor requires the TransactionManager to be available bound to JNDI for use in application servers. I hope you can unravel it from there. Dave