ConnectionReleaseMode (Hibernate JavaDocs)
Date: 2012-04-05

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

## org.hibernate
Enum ConnectionReleaseMode

    java.lang.Object
      java.lang.Enum<ConnectionReleaseMode>
          org.hibernate.ConnectionReleaseMode

All Implemented Interfaces:
  Serializable, Comparable<ConnectionReleaseMode>

    public enum ConnectionReleaseMode

extends Enum<ConnectionReleaseMode>

Defines the various policies by which Hibernate might release its underlying JDBC connection.

Enum Constant Summary
`AFTER_STATEMENT` Indicates that JDBC connection should be aggressively released after each SQL statement is executed.
`AFTER_TRANSACTION` Indicates that JDBC connections should be released after each transaction ends (works with both JTA-registered synch and HibernateTransaction API).
`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.

Method Summary
`static ConnectionReleaseMode` | `parse(String name)`
`static ConnectionReleaseMode` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static ConnectionReleaseMode[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Enum Constant Detail

### 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.

Method Detail

### values

    public static ConnectionReleaseMode[] 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 (ConnectionReleaseMode c : ConnectionReleaseMode.values())
          System.out.println(c);

  Returns:
    an array containing the constants of this enum type, in the order they are declared

### valueOf

    public static ConnectionReleaseMode 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 name
    `NullPointerException` - if the argument is null

### parse

    public static ConnectionReleaseMode parse(String name)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.