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

page 561 exercise question

Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
What is the answer for the fourth scenario

The exception for when the client starts a transaction, and the Container has to roll it back.

At first I thought it was TransactionRolledbackException/TransactionRolledBackLocalException but I'm a little confused as to when that exception would be thrown. It also could be any runtime exception, because they always cause the Container to rollback a transaction.
Can someone please clear up my confusion.
Much appreciated.
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith,
TransactionRolledbackException/TransactionRolledBackLocalException both are system exception (RemoteException for remote clients / EJBException for local ones). So it's not contradictory with what you write: if a RuntimeException is thrown, the container will rollback the transaction and, in case the client started the transaction, will then throw TransactionRolledbackException or TransactionRolledBackLocalException which are just more specialized system exceptions.
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic