• 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

system exceptions + CMT or BMT

Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic