程序包 org.hibernate
枚举 ConnectionReleaseMode
- java.lang.Object
-
- java.lang.Enum<ConnectionReleaseMode>
-
- org.hibernate.ConnectionReleaseMode
-
- 所有已实现的接口:
Serializable,Comparable<ConnectionReleaseMode>
public enum ConnectionReleaseMode extends Enum<ConnectionReleaseMode>
Defines the various policies by which Hibernate might release its underlying JDBC connection. Inverse ofConnectionAcquisitionMode.- 作者:
- Steve Ebersole
-
-
枚举常量概要
枚举常量 枚举常量 说明 AFTER_STATEMENTIndicates that JDBC connection should be aggressively released after each SQL statement is executed.AFTER_TRANSACTIONIndicates that JDBC connections should be released after each transaction ends (works with both JTA-registered synch and HibernateTransaction API).ON_CLOSEIndicates that connections should only be released when the Session is explicitly closed or disconnected; this is the legacy (Hibernate2 and pre-3.1) behavior.
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static ConnectionReleaseModeinterpret(Object setting)static ConnectionReleaseModeparse(String name)Alias forvalueOf(String)using upper-case version of the incoming name.static ConnectionReleaseModevalueOf(String name)返回带有指定名称的该类型的枚举常量。static ConnectionReleaseMode[]values()按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
-
-
-
枚举常量详细资料
-
AFTER_STATEMENT
public static final ConnectionReleaseMode AFTER_STATEMENT
Indicates that 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.
-
AFTER_TRANSACTION
public static final ConnectionReleaseMode AFTER_TRANSACTION
Indicates that JDBC connections should be released after each transaction ends (works with both JTA-registered synch and HibernateTransaction API). This mode may not be used with an application server JTA datasource. This is the default mode starting in 3.1; was previouslyON_CLOSE.
-
ON_CLOSE
public static final ConnectionReleaseMode ON_CLOSE
Indicates that connections should only be released when the Session is explicitly closed or disconnected; this is the legacy (Hibernate2 and pre-3.1) behavior.
-
-
方法详细资料
-
values
public static ConnectionReleaseMode[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (ConnectionReleaseMode c : ConnectionReleaseMode.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
public static ConnectionReleaseMode valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类型没有带有指定名称的常量NullPointerException- 如果参数为空值
-
parse
public static ConnectionReleaseMode parse(String name)
Alias forvalueOf(String)using upper-case version of the incoming name.- 参数:
name- The name to parse- 返回:
- The matched enum value.
-
interpret
public static ConnectionReleaseMode interpret(Object setting)
-
-