Class CayenneTransaction
java.lang.Object
org.apache.cayenne.tx.BaseTransaction
org.apache.cayenne.tx.CayenneTransaction
- All Implemented Interfaces:
Transaction
Represents a Cayenne-managed local 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
ConstructorsConstructorDescriptionCayenneTransaction(JdbcEventLogger logger) CayenneTransaction(JdbcEventLogger jdbcEventLogger, TransactionDescriptor descriptor) -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Starts a Transaction.protected voidconnectionAdded(Connection connection) booleanIs this transaction managed by external transaction managerprotected voidprotected voidMethods inherited from class BaseTransaction
addConnection, addListener, bindThreadTransaction, close, commit, getConnections, getExistingConnection, getOrCreateConnection, getThreadTransaction, isRollbackOnly, rollback, setRollbackOnlyModifier and TypeMethodDescriptionprotected ConnectionaddConnection(String connectionName, Connection connection) voidaddListener(TransactionListener listener) static voidbindThreadTransaction(Transaction transaction) Binds a Transaction to the current thread.protected voidclose()Closes all connections associated with transaction.voidcommit()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
-
CayenneTransaction
-
CayenneTransaction
- Since:
- 4.1
-
-
Method Details
-
begin
public void begin()Description copied from class:BaseTransactionStarts a Transaction. If Transaction is not started explicitly, it will be started when the first connection is added.- Specified by:
beginin interfaceTransaction- Overrides:
beginin classBaseTransaction
-
connectionAdded
- Overrides:
connectionAddedin classBaseTransaction
-
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
-