Why an onMessage call in Message-driven bean is always a seperate transaction

Showing Answers 1 - 4 of 4 Answers

Anand

  • Apr 26th, 2005
 

The MDB is stateless and inherently each message is unique with respect to the MDB. 
Each message needs to be processed independently. Hence the need for separate transactions

  Was this answer useful?  Yes

Message driven beans cannot be instantiated by a client application. The container creates the mdb instantiates an mdb each time a message is available on a jms queue. Hence by default each message is processed in a seperate transaction, whose life is as long as the message processing isnt complete. In case of failure of processing this message, the transaction is rolledback and the message put back onto the queue.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions