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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHandler(TransactionDescriptor descriptor) <T> TStarts a new transaction (or joins an existing one) callingTransactionalOperation.perform(), and then committing or rolling back the transaction.<T> TperformInTransaction(TransactionalOperation<T> op, TransactionDescriptor descriptor) Performs operation in a transaction which parameters described by descriptor.<T> TperformInTransaction(TransactionalOperation<T> op, TransactionFactory transactionFactory) Performs an operation in a transaction created by the supplied factory, instead of the configured one.<T> TperformInTransaction(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> TperformInTransaction(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:TransactionManagerStarts a new transaction (or joins an existing one) callingTransactionalOperation.perform(), and then committing or rolling back the transaction.- Specified by:
performInTransactionin 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:TransactionManagerStarts 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:
performInTransactionin 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:TransactionManagerPerforms operation in a transaction which parameters described by descriptor.- Specified by:
performInTransactionin 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:TransactionManagerPerforms 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:
performInTransactionin 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
-
performInTransaction
public <T> T performInTransaction(TransactionalOperation<T> op, TransactionFactory transactionFactory) Description copied from interface:TransactionManagerPerforms an operation in a transaction created by the supplied factory, instead of the configured one. This lets callers run an operation in a special transaction, such as aReadOnlyTransaction. Behaves likeTransactionPropagation.NESTED- joining an existing transaction if one is bound, otherwise creating a new one from the given factory.- Specified by:
performInTransactionin interfaceTransactionManager- Type Parameters:
T- returned value type- Parameters:
op- an operation to perform within the transaction.transactionFactory- a factory for the transaction to run the operation in.- Returns:
- a value returned by the "op" operation.
- Since:
- 5.0
-
getHandler
protected DefaultTransactionManager.BaseTransactionHandler getHandler(TransactionDescriptor descriptor)
-