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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for the TransactionDescriptor. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intKeep database default isolation level -
Constructor Summary
ConstructorsConstructorDescriptionTransactionDescriptor(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 TransactionDescriptorReturns descriptor with theTransactionPropagation.NESTEDpropagation and theISOLATION_DEFAULTisolation 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 followingConnectionconstants:Connection.TRANSACTION_READ_UNCOMMITTED,Connection.TRANSACTION_READ_COMMITTED,Connection.TRANSACTION_REPEATABLE_READ,Connection.TRANSACTION_SERIALIZABLE, orTransactionDescriptor.ISOLATION_DEFAULTpropagation- transaction propagation behaviour- See Also:
-
TransactionDescriptor
Deprecated.since 4.2. Usebuilder()method instead.Create transaction descriptor with desired isolation level andNESTEDpropagation- Parameters:
isolation- one of the followingConnectionconstants: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.NESTEDpropagation and theISOLATION_DEFAULTisolation level- Returns:
- default descriptor
- Since:
- 4.2
-