org.apache.openejb.core.transaction
Class TxMandatory
java.lang.Object
org.apache.openejb.core.transaction.JtaTransactionPolicy
org.apache.openejb.core.transaction.TxMandatory
- All Implemented Interfaces:
- TransactionPolicy
public class TxMandatory
- extends JtaTransactionPolicy
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.
Method Summary |
void |
commit()
Commits or rolls back this TransactionPolicy. |
Transaction |
getCurrentTransaction()
|
boolean |
isClientTransaction()
Is this policy running in an inhreited transaction? Some
TransactionTypes, such as Required or Supported, use the caller's
transaction instead of starting a new transaction. |
boolean |
isNewTransaction()
Is this a new transaction and not an inhreited transaction or no transaction? Some
TransactionTypes, such as Required or Supported, use the caller's
transaction instead of starting a new transaction. |
Methods inherited from class org.apache.openejb.core.transaction.JtaTransactionPolicy |
beginTransaction, completeTransaction, enlistResource, fireNonTransactionalCompletion, getResource, getTransaction, getTransactionType, isRollbackOnly, isTransactionActive, putResource, registerSynchronization, removeResource, resumeTransaction, rollbackTransaction, setRollbackOnly, setRollbackOnly, suspendTransaction, toString |
TxMandatory
public TxMandatory(TransactionManager transactionManager)
throws SystemException,
ApplicationException
- Throws:
SystemException
ApplicationException
isNewTransaction
public boolean isNewTransaction()
- Description copied from interface:
TransactionPolicy
- Is this a new transaction and not an inhreited transaction or no transaction? Some
TransactionTypes, such as Required or Supported, use the caller's
transaction instead of starting a new transaction. If there is no active
transaction (e.g., TransactionType is NotSupported), this method will
- Returns:
- true if this not an inherited transaction
isClientTransaction
public boolean isClientTransaction()
- Description copied from interface:
TransactionPolicy
- Is this policy running in an inhreited transaction? Some
TransactionTypes, such as Required or Supported, use the caller's
transaction instead of starting a new transaction. If there is no active
transaction (e.g., TransactionType is NotSupported), this method will
return false.
- Returns:
- true if this is an inherited transaction
getCurrentTransaction
public Transaction getCurrentTransaction()
- Specified by:
getCurrentTransaction
in class JtaTransactionPolicy
commit
public void commit()
- Description copied from interface:
TransactionPolicy
- Commits or rolls back this TransactionPolicy. If there the actual
transaction is completed or there is no actual transaction, the
registered TransactionSynchronization are called. Otherwise, the
registered TransactionSynchronization are called when the actual
transaction is completed.
Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.