Class DefaultTransactionManager

java.lang.Object
org.apache.cayenne.tx.DefaultTransactionManager
All Implemented Interfaces:
TransactionManager

public class DefaultTransactionManager extends Object implements TransactionManager
Since:
4.0
  • Constructor Details

  • Method Details

    • performInTransaction

      public <T> T performInTransaction(TransactionalOperation<T> op)
      Description copied from interface: TransactionManager
      Starts a new transaction (or joins an existing one) calling TransactionalOperation.perform(), and then committing or rolling back the transaction.
      Specified by:
      performInTransaction in interface TransactionManager
      Type Parameters:
      T - returned value type
      Parameters:
      op - an operation to perform within the transaction.
      Returns:
      a value returned by the "op" operation.
    • performInTransaction

      public <T> T performInTransaction(TransactionalOperation<T> op, TransactionListener callback)
      Description copied from interface: TransactionManager
      Starts a new transaction (or joins an existing one) calling TransactionalOperation.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 interface TransactionManager
      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

      public <T> T performInTransaction(TransactionalOperation<T> op, TransactionDescriptor descriptor)
      Description copied from interface: TransactionManager
      Performs operation in a transaction which parameters described by descriptor.
      Specified by:
      performInTransaction in interface TransactionManager
      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 interface TransactionManager
      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