org.openejb.core.transaction
Class TxSupports
java.lang.Object
|
+--org.openejb.core.transaction.TransactionPolicy
|
+--org.openejb.core.transaction.TxSupports
- public class TxSupports
- extends TransactionPolicy
17.6.2.3 Supports
The Container invokes an enterprise Bean method whose transaction attribute
is set to Supports as follows.
• If the client calls with a transaction context, the Container performs
the same steps as described in the Required case.
• If the client calls without a transaction context, the Container performs
the same steps as described in the NotSupported case.
The Supports transaction attribute must be used with caution. This is
because of the different transactional semantics provided by the two
possible modes of execution. Only the enterprise beans that will
execute correctly in both modes should use the Supports transaction
attribute.
- Version:
- $Revision: 1.1 $ $Date: 2002/01/21 08:09:03 $
Methods inherited from class org.openejb.core.transaction.TransactionPolicy |
beginTransaction, commitTransaction, discardBeanInstance, getContainer, getTxMngr, handleCallbackException, logSystemException, markTxRollbackOnly, rollbackTransaction, throwAppExceptionToServer, throwExceptionToServer, throwTxExceptionToServer |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TxSupports
public TxSupports(TransactionContainer container)
TxSupports
public TxSupports()
beforeInvoke
public void beforeInvoke(javax.ejb.EnterpriseBean instance,
TransactionContext context)
throws SystemException,
ApplicationException
- Overrides:
beforeInvoke
in class TransactionPolicy
afterInvoke
public void afterInvoke(javax.ejb.EnterpriseBean instance,
TransactionContext context)
throws ApplicationException,
SystemException
- Overrides:
afterInvoke
in class TransactionPolicy
handleApplicationException
public void handleApplicationException(java.lang.Throwable appException,
TransactionContext context)
throws ApplicationException
- Container's action
Re-throw AppException
Client's view
Client receives AppException. Can attempt to continue computation in the
transaction, and eventually commit the transaction (the commit would fail
if the instance called setRollbackOnly()).
- Overrides:
handleApplicationException
in class TransactionPolicy
handleSystemException
public void handleSystemException(java.lang.Throwable sysException,
javax.ejb.EnterpriseBean instance,
TransactionContext context)
throws ApplicationException,
SystemException
- A system exception is any exception that is not an Application Exception.
Container's action
-
Log the exception or error so that the System Administrator is alerted of
the problem.
-
Mark the transaction for rollback.
-
Discard instance. The Container must not invoke any business methods or
container callbacks on the instance.
-
Throw javax.transaction.TransactionRolledbackException to remote client;
throw javax.ejb.TransactionRolledbackLocalException to local client.
Client's view
Receives javax.transaction.TransactionRolledbackException or
javax.ejb.TransactionRolledbackLocalException.
Continuing transaction is fruitless.
- Overrides:
handleSystemException
in class TransactionPolicy