• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Distributed transactions in EJB

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Are we home yet? Wait, did we forget the tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic