Enum Class Propagation
- All Implemented Interfaces:
Serializable,Comparable<Propagation>,java.lang.constant.Constable
Propagation determines how a transaction behaves when it encounters an existing transaction context.
- Since:
- 6.2.0
- Author:
- wisdomme
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSupport a current transaction; throw an exception if no transaction exists.Execute within a nested transaction if a current transaction exists.Execute non-transactionally; throw an exception if a transaction exists.Execute non-transactionally, suspending the current transaction if one exists.Support a current transaction; create a new one if none exists.Create a new transaction, suspending the current transaction if one exists.Support a current transaction; execute non-transactionally if none exists. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PropagationReturns the enum constant of this class with the specified name.static Propagation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REQUIRED
Support a current transaction; create a new one if none exists.This is the default propagation behavior. If a transaction exists, the method joins it. Otherwise, a new transaction is created.
-
REQUIRES_NEW
Create a new transaction, suspending the current transaction if one exists.Always creates a new independent transaction, even if one already exists. The existing transaction (if any) is suspended and resumed after completion.
-
SUPPORTS
Support a current transaction; execute non-transactionally if none exists.If a transaction exists, the method joins it. Otherwise, it executes without a transaction.
-
NOT_SUPPORTED
Execute non-transactionally, suspending the current transaction if one exists.Always executes without a transaction, suspending any existing one.
-
MANDATORY
Support a current transaction; throw an exception if no transaction exists.Requires an existing transaction. If none exists, an exception is thrown.
-
NEVER
Execute non-transactionally; throw an exception if a transaction exists.Cannot execute within a transaction. If one exists, an exception is thrown.
-
NESTED
Execute within a nested transaction if a current transaction exists.Creates a savepoint within the existing transaction. If no transaction exists, behaves like REQUIRED.
-
-
Constructor Details
-
Propagation
private Propagation()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-