• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

question on TransactionRolledback Exception

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lets say a client carrying a transaction context, calls a business method on CMT bean and this business method throws NullPointerException while executing.

If this is correct scenario in which the Container throws TransactionRolledbackException to client, what about NullPointerException that is thrown in business method. Does it wrapped in TransactionRolledbackException?

Thanks,
Prashant
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When a client calls a business method with in a transaction (clients tx),
the Container Behaves in two ways depending on the transactional attribute of the business method.

The Spec never says that TransactionRolledbackException wraps the original system exception in this scenario.

But in case of MessageDrivenBeans, they say that conatiner has to wrap the original exception.

Vijay.
 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it means wraping of original message in TransactionRolledbackException is vendor dependent in case of session beans.

Thanks Vijay.

--Prashant
 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
other experts please confirm.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So it means wraping of original message in TransactionRolledbackException is vendor dependent in case of session beans.


Correct. All the client knows for sure is that it is pointless to continue with the transaction.

Note that TransactionRolledbackException is thrown to remote clients for CMT session or entity beans when the bean's business method runs in the context of the caller�s transaction.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think if the beanmethod encounters a NullPointerException, the bean will be discarded since this is SytemException, and the client will recieve a RemoteException or a EJBException. What the client does with its own transaction is up to the client.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic