# Class TransactionDescriptor

java.lang.Object
org.apache.cayenne.tx.TransactionDescriptor

public class TransactionDescriptor extends Object
Descriptor that allows to customize transaction logic. It provides following options:

- transaction isolation level
- transaction propagation logic.
- custom connection to use in a transaction

Since:
  4.1
See Also:
  - `TransactionManager.performInTransaction(TransactionalOperation, TransactionDescriptor)`
  - `CayenneRuntime.performInTransaction(TransactionalOperation, TransactionDescriptor)`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `TransactionDescriptor.Builder`
  Builder class for the TransactionDescriptor.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ISOLATION_DEFAULT`
  Keep database default isolation level

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `TransactionDescriptor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static TransactionDescriptor.Builder`
  `builder()`
  `static TransactionDescriptor`
  `defaultDescriptor()`
  Returns descriptor with the `TransactionPropagation.NESTED` propagation and the `ISOLATION_DEFAULT` isolation level
  `Supplier<Connection>`
  `getConnectionSupplier()`
  `int`
  `getIsolation()`
  `TransactionPropagation`
  `getPropagation()`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### ISOLATION_DEFAULT

    public static final int ISOLATION_DEFAULT
    Keep database default isolation level
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### TransactionDescriptor

    protected TransactionDescriptor()

- ## Method Details

  - ### getIsolation

    public int getIsolation()
    Returns:
      required isolation level

  - ### getPropagation

    public TransactionPropagation getPropagation()
    Returns:
      required propagation behaviour

  - ### getConnectionSupplier

    public Supplier<Connection> getConnectionSupplier()
    Returns:
      custom connection supplier, passed by user
    Since:
      4.2

  - ### builder

    public static TransactionDescriptor.Builder builder()
    Returns:
      TransactionDescriptor Builder
    Since:
      4.2

  - ### defaultDescriptor

    public static TransactionDescriptor defaultDescriptor()
    Returns descriptor with the `TransactionPropagation.NESTED` propagation and the `ISOLATION_DEFAULT` isolation level
    Returns:
      default descriptor
    Since:
      4.2