• 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

Unexpected exception can be handled safely ?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From Mikalai Zaikin' SBCD Study guide, 12.0

QUOTE: An application exception thrown by an enterprise bean instance should NOT automatically rollback a client's transaction. The client should typically be given a chance to recover a transaction from an application exception.

Ok, but...

QUOTE : An unexpected exception that may have left the instance's state variables and/or underlying persistent data in an inconsistent state can be handled safely.

I miss the point here Does it mean that the client may do the rollback himself when an unexpected application exception happens in the bean, and may also catch the exception and ignore it ?

Regards
Diego Amicabile
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What if the client caught an application exception & realized that even if it could continue, the transaction would never commit. Or if it tried to update the underlying database, the data integrity would be compromised?

The client could/should initiate the roll back itself, isn't it?

Technically, the client could catch it, ignore it, do an update & corrupt the database. But at the end of the day, someone has to fix it (but thats another story).

But does it make sense for the client to press on if the outcome is fruitless & may result in dire consequences?
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic