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.
The moose likes EJB and other Java EE Technologies and the fly likes Transaction roll back while using Oracle XA driver 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 » Java » EJB and other Java EE Technologies
Bookmark "Transaction roll back while using Oracle XA driver" Watch "Transaction roll back while using Oracle XA driver" New topic
Author

Transaction roll back while using Oracle XA driver

Anas Mohammed
Greenhorn

Joined: Dec 16, 2006
Posts: 4
I am using an Oracle XA driver. Now, a transaction is placing a message in queue ( An MDB listens to this queue and process the message). The parent transaction is continuing its work. At some point, an exception is thrown in the parent transaction and the whole transaction rolls back. Now, what will happen to the message put in the queue. Will it be removed?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

"AMK"

Please click on the My Profile link above and change your display name to meet the JavaRanch Naming Policy of using your real first and real last names.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Pratheep Nair
Greenhorn

Joined: Sep 20, 2005
Posts: 14
If you make the queue transactional, yes the messages will be removed.
Anas Mohammed
Greenhorn

Joined: Dec 16, 2006
Posts: 4
Thanks Pratheep, but will this happen even if the queue is in an external system. Say, a middleware.

Also, what if an MDB in the external system has already taken this message and started processing.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

"Aryan MK", Mark's request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Anas Mohammed
Greenhorn

Joined: Dec 16, 2006
Posts: 4
Sorry, but that was my name. Any way, I have changed it now. Thanks for pointing it out. ( I had changed it from AMK, after Marks suggestion)
Pratheep Nair
Greenhorn

Joined: Sep 20, 2005
Posts: 14
As long as you can create the Queue as a resource within your container and the messages are controlled through your container's JMS server, you can make the Queue part of your transaction.
When the queue is part of a transaction, the message is not "delivered" until the original transaction commits. However, once the transaction is committed and the message is delivered, the onMessage of the MDB picks up the message and becomes part of a new transaction.
MDB's support only two types of transactions: Required and NotSupported. MDBs cannot participate in a client's transaction. They can create new transaction(s) and make further calls part of the transaction. If a MDB is not happy with a message it received (poison message), it can put it back into the queue.
Does it help
Anas Mohammed
Greenhorn

Joined: Dec 16, 2006
Posts: 4
Thank you very much Pratheep. Yes, it helped.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transaction roll back while using Oracle XA driver
 
Similar Threads
ora-1591 lock held in - doubt distributed transaction error
Connecting Websphere 5.0 to Oracle 8.1.7
Problem:(Urgent ) 2 Phase Commit by WebSphere on Oracle database and MQ Series
Container Managed Transactions with an MDB
Hibernate and XA datasource