Package io.vertx.sqlclient
Enum TransactionPropagation
- java.lang.Object
-
- java.lang.Enum<TransactionPropagation>
-
- io.vertx.sqlclient.TransactionPropagation
-
- All Implemented Interfaces:
Serializable
,Comparable<TransactionPropagation>
public enum TransactionPropagation extends Enum<TransactionPropagation>
Defines how the acquired connection will be managed during the execution of the function provided inPool.withTransaction(TransactionPropagation, Function)
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONTEXT
Keeps the acquired connection stored in the local context for as long as the given function executes.NONE
The acquired connection is not stored anywhere, making it local to the provided function execution and to wherever it is passed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TransactionPropagation
valueOf(String name)
Returns the enum constant of this type with the specified name.static TransactionPropagation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final TransactionPropagation NONE
The acquired connection is not stored anywhere, making it local to the provided function execution and to wherever it is passed.
-
CONTEXT
public static final TransactionPropagation CONTEXT
Keeps the acquired connection stored in the local context for as long as the given function executes. Any subsequent calls toPool.withTransaction(java.util.function.Function<io.vertx.sqlclient.SqlConnection, io.vertx.core.Future<T>>)
with this mode during the function execution will retrieve this connection from the context instead of creating another. The connection is removed from the local context when the function block has completed.
-
-
Method Detail
-
values
public static TransactionPropagation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TransactionPropagation c : TransactionPropagation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TransactionPropagation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
-