Package org.apache.cayenne.tx
Class TransactionDescriptor
java.lang.Object
org.apache.cayenne.tx.TransactionDescriptor
- Direct Known Subclasses:
DefaultTransactionDescriptor
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class for the TransactionDescriptor. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Keep database default isolation level -
Constructor Summary
ConstructorDescriptionTransactionDescriptor
(int isolation) Deprecated.since 4.2.TransactionDescriptor
(int isolation, TransactionPropagation propagation) Deprecated.since 4.2.TransactionDescriptor
(TransactionPropagation propagation) Deprecated.since 4.2. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
static TransactionDescriptor
Returns descriptor with theTransactionPropagation.NESTED
propagation and theISOLATION_DEFAULT
isolation levelint
-
Field Details
-
ISOLATION_DEFAULT
public static final int ISOLATION_DEFAULTKeep database default isolation level- See Also:
-
-
Constructor Details
-
TransactionDescriptor
Deprecated.since 4.2. Usebuilder()
method instead.- Parameters:
isolation
- one of the followingConnection
constants:Connection.TRANSACTION_READ_UNCOMMITTED
,Connection.TRANSACTION_READ_COMMITTED
,Connection.TRANSACTION_REPEATABLE_READ
,Connection.TRANSACTION_SERIALIZABLE
, orTransactionDescriptor.ISOLATION_DEFAULT
propagation
- transaction propagation behaviour- See Also:
-
TransactionDescriptor
Deprecated.since 4.2. Usebuilder()
method instead.Create transaction descriptor with desired isolation level andNESTED
propagation- Parameters:
isolation
- one of the followingConnection
constants:Connection.TRANSACTION_READ_UNCOMMITTED
,Connection.TRANSACTION_READ_COMMITTED
,Connection.TRANSACTION_REPEATABLE_READ
,Connection.TRANSACTION_SERIALIZABLE
, orTransactionDescriptor.ISOLATION_DEFAULT
-
TransactionDescriptor
Deprecated.since 4.2. Usebuilder()
method instead.- Parameters:
propagation
- transaction propagation behaviour- See Also:
-
-
Method Details
-
getIsolation
public int getIsolation()- Returns:
- required isolation level
-
getPropagation
- Returns:
- required propagation behaviour
-
getConnectionSupplier
- Returns:
- custom connection supplier, passed by user
- Since:
- 4.2
-
builder
- Returns:
- TransactionDescriptor Builder
- Since:
- 4.2
-
defaultDescriptor
Returns descriptor with theTransactionPropagation.NESTED
propagation and theISOLATION_DEFAULT
isolation level- Returns:
- default descriptor
- Since:
- 4.2
-