Package org.hibernate
Enum Class ConnectionReleaseMode
- All Implemented Interfaces:
Serializable
,Comparable<ConnectionReleaseMode>
,java.lang.constant.Constable
Enumerates various policies for releasing JDBC connections. Complementary to
ConnectionAcquisitionMode
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIndicates that the JDBC connection should be aggressively released after each SQL statement is executed.Indicates that the JDBC connection should be released after each transaction ends.Indicates that the JDBC connection should be released before each transaction commits or rolls back.Indicates that connections should only be released when the session is explicitly closed or disconnected. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionReleaseMode
static ConnectionReleaseMode
Alias forvalueOf(String)
using uppercase version of the incoming name.static ConnectionReleaseMode
Returns the enum constant of this class with the specified name.static ConnectionReleaseMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AFTER_STATEMENT
Indicates that the JDBC connection should be aggressively released after each SQL statement is executed. In this mode, the application must explicitly close all iterators and scrollable results.This mode may only be used with a JTA datasource.
-
BEFORE_TRANSACTION_COMPLETION
Indicates that the JDBC connection should be released before each transaction commits or rolls back.This works with both resource-local transactions and with JTA-registered synchronizations. It may be used with an application server JTA datasource.
-
AFTER_TRANSACTION
Indicates that the JDBC connection should be released after each transaction ends.This works with both resource-local transactions and with JTA-registered synchronizations. But it may not be used with an application server JTA datasource.
This is the default mode.
-
ON_CLOSE
Indicates that connections should only be released when the session is explicitly closed or disconnected.Prior to Hibernate 3.1, this was the default mode.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
parse
Alias forvalueOf(String)
using uppercase version of the incoming name.- Parameters:
name
- The name to parse- Returns:
- The matched enum value.
-
interpret
-