public enum Propagation extends Enum<Propagation>
Enum Constant and Description |
---|
MANDATORY
Support a current transaction, throw an exception if none exists.
|
NESTED
Execute within a nested transaction if a current transaction exists, behave like PROPAGATION_REQUIRED else.
|
NEVER
Execute non-transactionally, throw an exception if a transaction exists.
|
NOT_SUPPORTED
Execute non-transactionally, suspend the current transaction if one exists.
|
REQUIRED
Support a current transaction, create a new one if none exists.
|
REQUIRED_NEW
Create a new transaction, suspend the current transaction if one exists.
|
SUPPORTS
Support a current transaction, execute non-transactionally if none exists.
|
Modifier and Type | Method and Description |
---|---|
TransactionIndicator |
mayBeProceeded(Target target) |
static Propagation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Propagation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Propagation MANDATORY
public static final Propagation NESTED
Start a nested transaction if a transaction exists, start a new transaction otherwise.
public static final Propagation NEVER
Does not start a transaction. Fails if a transaction is present.
public static final Propagation NOT_SUPPORTED
Does not start a transaction. Suspends any existing transaction.
public static final Propagation REQUIRED
If a transaction exists, use that, if not, create a new one. In 95% of cases, this is what you need.
public static final Propagation REQUIRED_NEW
Always creates a new transaction, no matter if an existing transaction is present. If there is, it will be suspended for the duration of this method execution.
public static final Propagation SUPPORTS
Can use a transaction if one is present, but doesn't need one (and won't start a new one either)
public static Propagation[] values()
for (Propagation c : Propagation.values()) System.out.println(c);
public static Propagation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic TransactionIndicator mayBeProceeded(Target target)
Copyright © 2021. All rights reserved.