Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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

Transaction Question

 
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.
 
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.
 
Don't MAKE me come back there with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic