程序包 org.hibernate

枚举 ConnectionReleaseMode

    • 枚举常量详细资料

      • 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 previously ON_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 - 如果参数为空值