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

transaction exceptions

 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy!


I have two SLSB (A and B) with methods:



I suppose that bean A will receive EJBException and can continue with the transaction if the excepion is caught? If the exception is not caught then bean A is discarded?
The transaction of B is rolledback and bean B is discarded?

Am I right?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In EJBs, we have 2 type of exceptions are there
1) System Exception
2) EJB Exception

Transaction {
BusinessMethod1();
BusinessMethod2();
BusinessMethod3();
}

While performing above transaction, if any exception has happend

1) If Exception is System Exception:
Then Container will come into picture, rollback the data.

2) If Exception is EJB Exception:
Then developer will handle that the exception.


In your case.

Inside Session Bean A Business Method, user calling the Session Bean B Business Method.

Session Bean B business Method throws Exception, so that Session Bean A business method not handle the exception, it is ejb exception. User should take care while handling these excepions.



 
Ranch Hand
Posts: 49
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I suppose that bean A will receive EJBException and can continue with the transaction if the excepion is caught? If the exception is not caught then bean A is discarded?



Yup!!

The transaction of B is rolledback and bean B is discarded?



Yup AGAIN !
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic