• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Distributed transactions in EJB

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic