File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Distributed transactions in EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Distributed transactions in EJB" Watch "Distributed transactions in EJB" New topic
Author

Distributed transactions in EJB

Joginder Raperia
Greenhorn

Joined: Jan 06, 2004
Posts: 3
Hello,
Sorry I put the subject wrong earleir ..
I am a little bit confused about the distributed transactions.I am not clear about the following things.
1. If I have a method in EJB for which I have defined the transaction-attribute as 'Required' and I am using different resources in that method
a)Sending message to some JMS destination (Queue)
b) updates to database
In this case if the driver I am using is not XA compliant ,what will happen.Will any exception be thrown or what?
2. Is it possible that the JMS Message sender and the receiving MDB (MessageDrivenBean) participate in the same trabsaction if we use XA driver?
Thanks in advance.
Joginder
Goan Balchao
Ranch Hand

Joined: Mar 25, 2002
Posts: 93
Hi,
I don't know the answer to the first part of your question. I would guess, that if the driver is not XA compliant, the behaviour is not fully determined by the psec -- I seem to remeber reading that somewhere (I am not sure though)
As to the second part,
"2. Is it possible that the JMS Message sender and the receiving MDB (MessageDrivenBean) participate in the same trabsaction if we use XA driver?"
No it is not possible for the JMS sender and the MDB to participate in the same transaction because, by it's nature MDB's are asynchronous. They cannot be in the same Tx, becuase from the spec " transaction context does not flow with a JMS message" .
The only scenarion would be : You could have the message receipt and the invocation of the MDB to be part of the same Tx, if you use CMT with "Required" Tx attribute. If you use BMT, the message receipt is not a part of the Tx.
Hope that helps. And please update the solution to your XA question, if you get it.


Hemant Kamat<br />SCJP2<br />SCWCD<br />SCBCD<br />SCEA-I
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Distributed transactions in EJB
 
Similar Threads
XADataSource vs. Common Everyday DataSource
Disributes Transactions in EJB
Non XA Driver in a distributed environment - What is the Best Practice?
Problem:(Urgent ) 2 Phase Commit by WebSphere on Oracle database and MQ Series
Usage of XA vs Non-XA Driver for Transactions