This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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