Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Transaction Question

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic