org.openejb.core.transaction
Class TxManditory
java.lang.Object
org.openejb.core.transaction.TransactionPolicy
org.openejb.core.transaction.TxManditory
public class TxManditory
- extends TransactionPolicy
17.6.2.5 Mandatory
The Container must invoke an enterprise Bean method whose transaction
attribute is set to Mandatory in a client's transaction context. The client
is required to call with a transaction context.
? If the client calls with a transaction context, the container invokes the
enterprise Bean's method in the client's transaction context.
? If the client calls without a transaction context, the Container throws
the javax.transaction.TransactionRequiredException exception if the
client is a remote client, or the
javax.ejb.TransactionRequiredLocalException if the client is a local
client.
- Version:
- $Revision: 1912 $ $Date: 2005-06-16 15:29:56 -0700 (Thu, 16 Jun 2005) $
- Author:
- David Blevins
Fields inherited from class org.openejb.core.transaction.TransactionPolicy |
BeanManaged, container, logger, Mandatory, Never, NotSupported, policyType, Required, RequiresNew, Supports, txLogger |
Methods inherited from class org.openejb.core.transaction.TransactionPolicy |
beginTransaction, commitTransaction, discardBeanInstance, getContainer, getTxMngr, handleCallbackException, logSystemException, markTxRollbackOnly, resumeTransaction, rollbackTransaction, suspendTransaction, throwAppExceptionToServer, throwExceptionToServer, throwTxExceptionToServer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TxManditory
public TxManditory(TransactionContainer container)
TxManditory
public TxManditory()
policyToString
public java.lang.String policyToString()
- Overrides:
policyToString
in class TransactionPolicy
beforeInvoke
public void beforeInvoke(javax.ejb.EnterpriseBean instance,
TransactionContext context)
throws SystemException,
ApplicationException
- Specified by:
beforeInvoke
in class TransactionPolicy
- Throws:
SystemException
ApplicationException
afterInvoke
public void afterInvoke(javax.ejb.EnterpriseBean instance,
TransactionContext context)
throws ApplicationException,
SystemException
- Specified by:
afterInvoke
in class TransactionPolicy
- Throws:
ApplicationException
SystemException
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()).
- Specified by:
handleApplicationException
in class TransactionPolicy
- Throws:
ApplicationException
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.
- Specified by:
handleSystemException
in class TransactionPolicy
- Throws:
ApplicationException
SystemException
Copyright © 1999-2011 OpenEJB. All Rights Reserved.