Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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.
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic