# 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 SQLLogger`
  `sqlLogger`

  ### Fields inherited from class 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(SQLLogger sqlLogger)`
  `CayenneTransaction(SQLLogger sqlLogger, TransactionDescriptor descriptor)`

- ## Method Summary

  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 BaseTransaction

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

  ### Methods inherited from class Object

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

- ## Field Details

  - ### sqlLogger

    protected SQLLogger sqlLogger

- ## Constructor Details

  - ### CayenneTransaction

    public CayenneTransaction(SQLLogger sqlLogger)

  - ### CayenneTransaction

    public CayenneTransaction(SQLLogger sqlLogger, TransactionDescriptor descriptor)
    Since:
      4.1

- ## Method Details

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