Package org.apache.cayenne.tx
Class DefaultTransactionManager
java.lang.Object
org.apache.cayenne.tx.DefaultTransactionManager
- All Implemented Interfaces:
TransactionManager
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTransactionManager
(TransactionFactory txFactory, JdbcEventLogger jdbcEventLogger) -
Method Summary
Modifier and TypeMethodDescriptiongetHandler
(TransactionDescriptor descriptor) <T> T
Starts a new transaction (or joins an existing one) callingTransactionalOperation.perform()
, and then committing or rolling back the transaction.<T> T
performInTransaction
(TransactionalOperation<T> op, TransactionDescriptor descriptor) Performs operation in a transaction which parameters described by descriptor.<T> T
performInTransaction
(TransactionalOperation<T> op, TransactionListener callback) Starts a new transaction (or joins an existing one) callingTransactionalOperation.perform()
, and then committing or rolling back the transaction.<T> T
performInTransaction
(TransactionalOperation<T> op, TransactionListener callback, TransactionDescriptor descriptor) Performs operation in a transaction which parameters described by descriptor.
-
Constructor Details
-
DefaultTransactionManager
-
-
Method Details
-
performInTransaction
Description copied from interface:TransactionManager
Starts a new transaction (or joins an existing one) callingTransactionalOperation.perform()
, and then committing or rolling back the transaction.- Specified by:
performInTransaction
in interfaceTransactionManager
- Type Parameters:
T
- returned value type- Parameters:
op
- an operation to perform within the transaction.- Returns:
- a value returned by the "op" operation.
-
performInTransaction
Description copied from interface:TransactionManager
Starts a new transaction (or joins an existing one) callingTransactionalOperation.perform()
, and then committing or rolling back the transaction. As transaction goes through stages, callback methods are invoked allowing the caller to customize transaction parameters.- Specified by:
performInTransaction
in interfaceTransactionManager
- Type Parameters:
T
- returned value type- Parameters:
op
- an operation to perform within the transaction.callback
- a callback to notify as transaction progresses through stages.- Returns:
- a value returned by the "op" operation.
-
performInTransaction
Description copied from interface:TransactionManager
Performs operation in a transaction which parameters described by descriptor.- Specified by:
performInTransaction
in interfaceTransactionManager
- Type Parameters:
T
- result type- Parameters:
op
- an operation to perform within the transaction.descriptor
- transaction descriptor- Returns:
- a value returned by the "op" operation.
- Since:
- 4.1
-
performInTransaction
public <T> T performInTransaction(TransactionalOperation<T> op, TransactionListener callback, TransactionDescriptor descriptor) Description copied from interface:TransactionManager
Performs operation in a transaction which parameters described by descriptor. As transaction goes through stages, callback methods are invoked allowing the caller to customize transaction parameters.- Specified by:
performInTransaction
in interfaceTransactionManager
- Type Parameters:
T
- returned value type- Parameters:
op
- an operation to perform within the transaction.callback
- a callback to notify as transaction progresses through stages.descriptor
- transaction descriptor- Returns:
- a value returned by the "op" operation.
- Since:
- 4.1
-
getHandler
protected DefaultTransactionManager.BaseTransactionHandler getHandler(TransactionDescriptor descriptor)
-