• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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 ]
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic