Package org.apache.cayenne.tx

## Class CayenneTransaction

- java.lang.Object
- - org.apache.cayenne.tx.BaseTransaction
  - - org.apache.cayenne.tx.CayenneTransaction

- All Implemented Interfaces:
    `Transaction`

      public class CayenneTransaction
      extends BaseTransaction

  Represents a Cayenne-managed local Transaction.
  Since:
    4.0

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected JdbcEventLogger` | `logger` |

    - ### Fields inherited from class org.apache.cayenne.tx.BaseTransaction

      `connections, defaultIsolationLevel, descriptor, listeners, status, STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLEDBACK, STATUS_NO_TRANSACTION, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CayenneTransaction​(JdbcEventLogger logger)` |
    `CayenneTransaction​(JdbcEventLogger jdbcEventLogger, TransactionDescriptor descriptor)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `begin()` | Starts a Transaction.
    `protected void` | `connectionAdded​(Connection connection)` |
    `boolean` | `isExternal()` | Is this transaction managed by external transaction manager
    `protected void` | `processCommit()` |
    `protected void` | `processRollback()` |

    - ### Methods inherited from class org.apache.cayenne.tx.BaseTransaction

      `addConnection, addListener, bindThreadTransaction, close, commit, getConnections, getExistingConnection, getOrCreateConnection, getThreadTransaction, isRollbackOnly, rollback, setRollbackOnly`

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

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

- - ### Field Detail

    - #### logger

          protected JdbcEventLogger logger

  - ### Constructor Detail

    - #### CayenneTransaction

          public CayenneTransaction​(JdbcEventLogger logger)

    - #### CayenneTransaction

          public CayenneTransaction​(JdbcEventLogger jdbcEventLogger,
                                    TransactionDescriptor descriptor)

      Since:
        4.1

  - ### Method Detail

    - #### begin

          public void begin()

      Description copied from class: `BaseTransaction`
      Starts a Transaction. If Transaction is not started explicitly, it will be started when the first connection is added.
      Specified by:
        `begin` in interface `Transaction`
      Overrides:
        `begin` in class `BaseTransaction`

    - #### connectionAdded

          protected void connectionAdded​(Connection connection)

      Overrides:
        `connectionAdded` in class `BaseTransaction`

    - #### processCommit

          protected void processCommit()

      Specified by:
        `processCommit` in class `BaseTransaction`

    - #### processRollback

          protected void processRollback()

      Specified by:
        `processRollback` in class `BaseTransaction`

    - #### isExternal

          public boolean isExternal()

      Description copied from interface: `Transaction`
      Is this transaction managed by external transaction manager