Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

system exceptions + CMT or BMT

Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

IN HFE, it's said that in case of system exceptions , the container will always rollback the transaction, and throw either a RemoteExceptionn (remote view) or EJBException (local view). cf p.534

However, in the spec, there's a distinction to be made between rollback the transaction and mark the transaction for rollback.

This distinctin may concern first CMT vs BMT demarcation.
By example, for Message Driven Bean table 17 spec p.377 we can see that the container's action concsists in rollback the container-started transaction whereas the container's action consists in mark for rollback the transaction that has been started in case of BMT.

This distinction between rollback and only mark for rollback may have an impact also in the kind of exceptions thrown by the container.
Indeed, in the case of session or entity bean's business methods running in the context of the caller's transaction (table 15 p.375 spec) the container only marks the transaction for rollback and also throw javax.transaction.TransactionRolledbackException to Remote Clients and throws javax.ejb.TransactionRolledbackLocalException to Local Clients.
But in the case of session or entity bean's business methods running in the context of a transactio that the Container started immediately before dispatching the business method (this may happen with Required and RequiresNew attributes), the Container rollbacks the container-started transaction (table 15 p.375 spec) and throw RemoteException to remote clients and EJBException to local clients.

That's just for more complete information...
[ November 12, 2004: Message edited by: cyril vidal ]
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic