• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Transaction roll back while using Oracle XA driver

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you make the queue transactional, yes the messages will be removed.
 
Anas Mohammed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Anas Mohammed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Pratheep. Yes, it helped.
 
What are you doing? You are supposed to be reading this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic