Package org.hibernate

Enum Class ConnectionAcquisitionMode

java.lang.Object
java.lang.Enum<ConnectionAcquisitionMode>
org.hibernate.ConnectionAcquisitionMode
All Implemented Interfaces:
Serializable, Comparable<ConnectionAcquisitionMode>, java.lang.constant.Constable

public enum ConnectionAcquisitionMode extends Enum<ConnectionAcquisitionMode>
Indicates the manner in which JDBC connections are acquired. Complementary to ConnectionReleaseMode.
See Also:
  • Enum Constant Details

    • IMMEDIATELY

      public static final ConnectionAcquisitionMode IMMEDIATELY
      The Connection will be acquired as soon as a session is opened.

      This circumvents the ConnectionReleaseMode, as the Connection will then be held until the session is closed.

    • AS_NEEDED

      public static final ConnectionAcquisitionMode AS_NEEDED
      A Connection is acquired only when (and if) it's actually needed.

      This is the default (and legacy) behavior.

  • Method Details

    • values

      public static ConnectionAcquisitionMode[] 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

      public static ConnectionAcquisitionMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • interpret

      public static ConnectionAcquisitionMode interpret(String value)
    • interpret

      public static ConnectionAcquisitionMode interpret(Object setting)