• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Transaction confusion

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to figure out when a client would actually get back a TransactionRolledbackException or TransactionRolledbackLocalException.
Here's a scenario that I'm wondering about:
CMT is used. A client with an existing transaction calls a method on a bean that has a Required transaction attribute and so the method runs in the client's transaction. The bean method throws a null pointer exception. Will the client stack trace show a TransactionRolledbackException for a remote call or a NullPointerException or both?
Could a client get a TransactionRolledbackException in a situation other than the above scenario?
 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

CMT is used. A client with an existing transaction calls a method on a bean that has a Required transaction attribute and so the method runs in the client's transaction. The bean method throws a null pointer exception. Will the client stack trace show a TransactionRolledbackException for a remote call or a NullPointerException or both?
Could a client get a TransactionRolledbackException in a situation other than the above scenario?


If setRollbackOnly() is called before system exception (nullpoint or any unexpected exception) then method won't throw TransactionRollbackedException().
If setRollbackOnly() isn't define in that case remote method call will get TransactionRolledbackException(). Remember remote client get RemoteException() for any system exception throw at server side and those are never pass as it is by server. (only application exception are pass as its by server to client).
Also refer page number 551 from Head First EJB for exception hierarchy.
Hope this help.
 
no wonder he is so sad, he hasn't seen this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic