Class ExternalTransaction
java.lang.Object
org.apache.cayenne.tx.BaseTransaction
org.apache.cayenne.tx.ExternalTransaction
- All Implemented Interfaces:
Transaction
Represents a container-managed transaction.
- Since:
- 4.0
-
Field Summary
FieldsFields inherited from class BaseTransaction
connections, defaultIsolationLevel, descriptor, listeners, status, STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLEDBACK, STATUS_NO_TRANSACTION, STATUS_ROLLEDBACK, STATUS_ROLLING_BACKModifier and TypeFieldDescriptionprotected Map<String, Connection> protected intprotected TransactionDescriptorprotected Collection<TransactionListener> protected intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionExternalTransaction(JdbcEventLogger jdbcEventLogger) ExternalTransaction(JdbcEventLogger jdbcEventLogger, TransactionDescriptor descriptor) -
Method Summary
Modifier and TypeMethodDescriptionbooleanIs this transaction managed by external transaction managerprotected voidprotected voidMethods inherited from class BaseTransaction
addConnection, addListener, begin, bindThreadTransaction, close, commit, connectionAdded, getConnections, getExistingConnection, getOrCreateConnection, getThreadTransaction, isRollbackOnly, rollback, setRollbackOnlyModifier and TypeMethodDescriptionprotected ConnectionaddConnection(String connectionName, Connection connection) voidaddListener(TransactionListener listener) voidbegin()Starts a Transaction.static voidbindThreadTransaction(Transaction transaction) Binds a Transaction to the current thread.protected voidclose()Closes all connections associated with transaction.voidcommit()protected voidconnectionAdded(Connection connection) Returns all connections associated with the transaction.protected ConnectiongetExistingConnection(String name) getOrCreateConnection(String connectionName, DataSource dataSource) Retrieves a connection for the given symbolic name.static TransactionReturns a Transaction associated with the current thread, or null if there is no such Transaction.booleanvoidrollback()void
-
Field Details
-
logger
-
-
Constructor Details
-
ExternalTransaction
-
ExternalTransaction
- Since:
- 4.1
-
-
Method Details
-
processCommit
protected void processCommit()- Specified by:
processCommitin classBaseTransaction
-
processRollback
protected void processRollback()- Specified by:
processRollbackin classBaseTransaction
-
isExternal
public boolean isExternal()Description copied from interface:TransactionIs this transaction managed by external transaction manager
-