GeekInterview.com
Series: Subject: Topic:
Question: 126 of 180

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

Asked by: Interview Candidate | Asked on: Apr 26th, 2005
Showing Answers 1 - 2 of 2 Answers
Anand

Answered On : 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

  
Login to rate this answer.
nemashailendra

Answered On : Mar 25th, 2010

View all answers by nemashailendra

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.