• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transaction exceptions

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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?
 
ramesh vanka
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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.



 
Anirudh Gupta
Ranch Hand
Posts: 49
Java
  • Mark post as helpful
  • send pies
  • 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 !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic