File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJBs and XA transactions 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 "EJBs and XA transactions" Watch "EJBs and XA transactions" New topic

EJBs and XA transactions

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I've run into a problem recently with XA transactions that's confusing me and I wondered if anyone else has dealt with it... I've changed some session EJBs to MDBs in an existing application - had to set up all the JMS resources for the first time to. I wanted to make my MDBs CMT - but when I tried to test them, I got an error saying that the MDB required a transaction, but the container was unable to provide one without an XA compatible driver. OK... so I switched my database driver in the datasource used by my application to the XA driver. Now my MDBs work - but existing CMT EJBs that are marked as NotSupported, Supports, etc. that don't use transactions bomb out with errors from the container stating 'Not in a transaction'... So does XA *require* that *everything* always be in a transaction? Or does it sound like I have something set up wrong?

I'm using Weblogic 8.1 and Oracle 8, if that's any help...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Have you by any chance changed your app so that a session EJB is sending a JMS message which must be processed in a transaction?

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Nope, the JMS message is being sent directly from a servlet, and the EJBs that were throwing "Not in a transaction" were completely separate from the MDBs - they weren't calling the MBDs, and the MDBs weren't calling them.

Still haven't found out anything - so far the workaround is to make the MDBs BMT.
I agree. Here's the link:
subject: EJBs and XA transactions
It's not a secret anymore!