aspose file tools*
The moose likes Websphere and the fly likes WAS 5.0 : XA datasource(9i) in a UserTransaction throws an error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS 5.0 : XA datasource(9i) in a UserTransaction throws an error" Watch "WAS 5.0 : XA datasource(9i) in a UserTransaction throws an error" New topic
Author

WAS 5.0 : XA datasource(9i) in a UserTransaction throws an error

Juzar Roopawalla
Ranch Hand

Joined: Oct 30, 2001
Posts: 37
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.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I was asked to post the code I'm using since the stuff I refered to was specific to v4. This should work in both v4 and 5.
It uses Log4j logging, but you should be able to manage that...
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WAS 5.0 : XA datasource(9i) in a UserTransaction throws an error