• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction is not rolled back under BMT when application exception happens

 
Himai Minh
Ranch Hand
Posts: 1400
8
  • Mark post as helpful
  • send pies
  • 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 ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2781
174
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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

  •  
    What are you doing? You are supposed to be reading this tiny ad!
    the new thread boost feature brings a LOT of attention to your favorite threads
    https://coderanch.com/t/674455/Thread-Boost-feature
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!