org.apache.cayenne.tx

## 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 Summary

    Constructors
    Constructor and Description
    `DefaultTransactionManager(TransactionFactory txFactory, JdbcEventLogger jdbcEventLogger)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected <T> T` | `performInLocalTransaction(TransactionalOperation<T> op, TransactionListener callback)`
    `<T> T` | `performInTransaction(TransactionalOperation<T> op)` Starts a new transaction (or joins an existing one) calling `TransactionalOperation.perform()`, and then committing or rolling back the transaction.
    `<T> T` | `performInTransaction(TransactionalOperation<T> op, TransactionListener callback)` Starts a new transaction (or joins an existing one) calling `TransactionalOperation.perform()`, and then committing or rolling back the transaction.
    `protected <T> T` | `performInTransaction(Transaction tx, TransactionalOperation<T> op, TransactionListener callback)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultTransactionManager

          public DefaultTransactionManager(TransactionFactory txFactory,
                                           JdbcEventLogger jdbcEventLogger)

  - ### Method Detail

    - #### 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`
      Parameters:
        `op` - an operation to perform within the trsnaction.
      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`
      Parameters:
        `op` - an operation to perform within the trsnaction.
        `callback` - a callback to notify as transaction progresses through stages.
      Returns:
        a value returned by the "op" operation.

    - #### performInLocalTransaction

          protected <T> T performInLocalTransaction(TransactionalOperation<T> op,
                                                    TransactionListener callback)

    - #### performInTransaction

          protected <T> T performInTransaction(Transaction tx,
                                               TransactionalOperation<T> op,
                                               TransactionListener callback)

Copyright © 2001–2023 Apache Cayenne. All rights reserved.