• Post Reply Bookmark Topic Watch Topic
  • New Topic

transaction: SLSB->JMS  RSS feed

 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a Message Driven Bean joing an existing transaction? I want to start a transaction from a SLSB, perform some database updates, then use JMS to send an asynchronous message. The message must join the transaction.

Is this impossible because the SLSB code and JMS code are executed in different threads?

Does anyone know of a way to write a transaction which spans the SLSB and the MDB?

Thanks in advance.

-Saha
 
Andreas Schaefer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends. In JMS every transactions ends on the server meaning that when you send a message the transaction demarcation ends when the message is placed on the server. The read of the message cannot be done in the same transaction whatsoever because that would defeat the purpose of an asynchronouse message delivery.
That said the sending of the message can be part of your transaction meaning that in case the transaction rolls back the message is discarded.

-Andy
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Andy...its cleared up.

-Saha
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!