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 in `Pool.withTransaction(TransactionPropagation, Function)`.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and 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 and 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.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### 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 to `Pool.withTransaction(java.util.function.Function<io.vertx.sqlclient.SqlConnection, io.vertx.core.Future<T>>, io.vertx.core.Handler<io.vertx.core.AsyncResult<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 name
        `NullPointerException` - if the argument is null

Copyright © 2023 Eclipse. All rights reserved.