• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transaction is not rolled back under BMT when application exception happens

 
Bartender
Posts: 2419
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On p .387 and p.393, I noticed these:
1. Under BMT, when a singleton/stateless/stateful bean throws an application exception , the transaction is not rollback by the container. And the application exception is thrown to the client.
2. Under BMT, when a message driven bean throws an application exception, the transaction is not rollback neither. The exception is re thrown to resource adaptor.

Why the transaction is not rollback when application exception occurs under BMT?
Or, the bean provider (developer) has to handle this by calling UserTransaction.rollback() in the business method when the application exception is caught ?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An application exception thrown by an enterprise bean should not automatically rollback a client’s transaction. (no matter whether the bean is BM or CM)

The reason why is:
  • An application exception is an exception defined by the Bean Provider as part of the business logic of an application.
  • A client can typically recover from an application exception

  • reply
      Bookmark Topic Watch Topic
    • New Topic