Package org.hibernate.resource.jdbc.spi
Enum PhysicalConnectionHandlingMode
- java.lang.Object
-
- java.lang.Enum<PhysicalConnectionHandlingMode>
-
- org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode
-
- All Implemented Interfaces:
Serializable
,Comparable<PhysicalConnectionHandlingMode>
public enum PhysicalConnectionHandlingMode extends Enum<PhysicalConnectionHandlingMode>
Enumerates valid combinations ofConnectionAcquisitionMode
andConnectionReleaseMode
.- See Also:
JdbcSettings.CONNECTION_HANDLING
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DELAYED_ACQUISITION_AND_HOLD
TheConnection
will be acquired as soon as it is needed and then held until the session is closed.DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT
TheConnection
will be acquired as soon as it is needed; it will be released after each statement is executed.DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION
TheConnection
will be acquired as soon as it is needed; it will be released after each transaction is completed.DELAYED_ACQUISITION_AND_RELEASE_BEFORE_TRANSACTION_COMPLETION
TheConnection
will be acquired as soon as it is needed; it will be released before commit or rollback.IMMEDIATE_ACQUISITION_AND_HOLD
TheConnection
will be acquired as soon as the session is opened and held until the session is closed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionAcquisitionMode
getAcquisitionMode()
ConnectionReleaseMode
getReleaseMode()
static PhysicalConnectionHandlingMode
interpret(Object setting)
static PhysicalConnectionHandlingMode
interpret(ConnectionAcquisitionMode acquisitionMode, ConnectionReleaseMode releaseMode)
static PhysicalConnectionHandlingMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static PhysicalConnectionHandlingMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IMMEDIATE_ACQUISITION_AND_HOLD
public static final PhysicalConnectionHandlingMode IMMEDIATE_ACQUISITION_AND_HOLD
TheConnection
will be acquired as soon as the session is opened and held until the session is closed. This is the only valid combination including immediate acquisition of the Connection
-
DELAYED_ACQUISITION_AND_HOLD
public static final PhysicalConnectionHandlingMode DELAYED_ACQUISITION_AND_HOLD
TheConnection
will be acquired as soon as it is needed and then held until the session is closed. This is the original Hibernate behavior.
-
DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT
public static final PhysicalConnectionHandlingMode DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT
TheConnection
will be acquired as soon as it is needed; it will be released after each statement is executed.
-
DELAYED_ACQUISITION_AND_RELEASE_BEFORE_TRANSACTION_COMPLETION
public static final PhysicalConnectionHandlingMode DELAYED_ACQUISITION_AND_RELEASE_BEFORE_TRANSACTION_COMPLETION
TheConnection
will be acquired as soon as it is needed; it will be released before commit or rollback.
-
DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION
public static final PhysicalConnectionHandlingMode DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION
TheConnection
will be acquired as soon as it is needed; it will be released after each transaction is completed.
-
-
Method Detail
-
values
public static PhysicalConnectionHandlingMode[] 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 (PhysicalConnectionHandlingMode c : PhysicalConnectionHandlingMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PhysicalConnectionHandlingMode 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
-
getAcquisitionMode
public ConnectionAcquisitionMode getAcquisitionMode()
-
getReleaseMode
public ConnectionReleaseMode getReleaseMode()
-
interpret
public static PhysicalConnectionHandlingMode interpret(Object setting)
-
interpret
public static PhysicalConnectionHandlingMode interpret(ConnectionAcquisitionMode acquisitionMode, ConnectionReleaseMode releaseMode)
-
-