wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes MDB calls EJB requires new transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MDB calls EJB requires new transaction" Watch "MDB calls EJB requires new transaction" New topic
Author

MDB calls EJB requires new transaction

Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 136
Hi,

I am on WebLogic 8.1 SP3 running against Oracle 10g.

I noticed that if I have a message driven bean call another session bean that in turn makes JDBC calls, the session bean's transaction attribute must be "requiresNew", if it is "required", I got the following exception:

JDBC driver does not support XA, can not participate in a two-phase commit.

What does that mean?
Thanks.
Yan
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

The first thing to see is what driver you are using? It should work with oracle thin driver.
Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 136
it is indeed Oracle thin driver.
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

You won't believe that I ran into the same issue today.
My understanding is - in this case, two resources are involved :
The XAJMSConnectionFactory and your Datasource. This requires a 2PC protocol which is not supported by normal oracle thin driver. Probably oracle thin(XA) driver would work. However, there is an option of emulating 2PC even with non-XA drivers (Advanced prop of Datasource in Weblogic console).
And 'Required' tx attribute forces operations involving connections from two different sources to share the same tx context which is possible only by using 2PC. Hence the problem.
I would like to hear if you have found out something which makes more sense.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MDB calls EJB requires new transaction
 
Similar Threads
JTA or JDBC transaction
Q: transaction mgt in session bean wrapping JDBC
Transaction-propagation
Deployment strategy and transactions
Session Auto-Comit?