Help coderanch get a
new server
by contributing to the fundraiser
  • 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Container and Rollback

Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please comment on the truth ness of the following comments...

1. Container is not responsible for committing or rolling back transactions that have been initiated by the client.
2. The container is only responsible for rolling back a system exception for an message-driven bean with container-managed transaction demarcation and when the bean method runs in the context of a transaction started by the container. A transaction is not rolled backed by the container as a result of a system exception thrown when the transaction runs with an unspecified transaction context and also when a bean is declared with bean-managed transaction demarcation.

And what should be the correct answer for the following question...
What will the container do when a bean managed message driven bean throws a system exception? [Check all correct answers]
1. Log the system exception.
2. Mark the transaction for rollback.
3. The container will discard the message driven bean instance and will not invoke any business methods or container callbacks on the instance.
4. The container will commit the transaction unless the deployment descriptor specifies otherwise.
5. The client will receive a RemoteException.

As per the given answer... option 1, 2, and 3. I am confused as MDB is a BMT bean so option 2 should not be true.


Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Option 2 is correct. Remember, a transaction is scoped at method level. So, if a system exception is thrown, the container must ensure that the transaction is ended. (We are assuming that the exception is not handled.) This is done by marking for rollback a transaction that has been started, but not yet completed, by the instance.
please buy this thing and then I get a fat cut of the action:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic