Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction Question

 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following are requirements of a Message Driven Bean with regards to bean managed transactions?



1. It must be responsible for it's own persistence.



2. A message-driven bean instance must commit a transaction before the onMessage() method returns.



3. A message-driven bean must not commit a transaction before the onMessage() method returns.



4. A message-driven bean must use entity beans for asynchronous communication.



5. A message driven bean cannot use bean managed transactions only container managed transactions.



I think 1. is correct, but www.ejbcertificate says 2.

I am sure Message driven bean can issue a rollback in BMT.
 
Vitaliy Geraymovych
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mini,

Answer 1 will be incorrect. MDB is like stateless session beans, only asynchronous. Therefore, there is no need to persist them.
Answer 2 means that at the end of the method the bean is responsible with finishing the transaction (in the context of BMT)(commit or rollback). Answer 2 is correct.

Vitaliy
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vitaliy Geraymovych:
Mini,

Answer 1 will be incorrect. MDB is like stateless session beans, only asynchronous. Therefore, there is no need to persist them.
Answer 2 means that at the end of the method the bean is responsible with finishing the transaction (in the context of BMT)(commit or rollback). Answer 2 is correct.

Vitaliy



Thanks for your reply. I wanted to pick up the answer 2 as well, but it says the transaction needs to commit, which was the bit I didn't see correct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic