On the first page in the ExceptionHandling.pdf document, it is mentioned under the heading "Client View":
if(ctx.getRollbackOnly()) //impossible to commit tx else //do more work and commit tx
What is this ctx? Is it SessionContext/EntityContext? If the answer is yes then how the standalone/remote client (non-EJB) gets access to SessionContext/EntityContext? This can only be true this were a EJB making call on other EJB? Please clarify my doubt.
A bean calling another bean may be called a client.
Any bean's way of knowing if 'setRollbakOnly()' has been called by some bean and/or method earlier is to query its own context by calling 'getRollbackOnly()'
So if Bean A calls Bean B, 1. Bean A is said to be a client of Bean B 2. Bean B might query its own context to check if any bean in the call stack has already called 'setRollbackOnly()'. If yes, Bean B might not go ahead with all the processing and waste time.
[SCJP2, SCWCD1.3, SCBCD]
posted 15 years ago
Thanks for the detailed explanation.
SCJP, SCJD, SCWCD, SCBCD, SCEA
Skool. Stay in. Smartness. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop