Top Description Fields Constructors Methods
org.hibernate

public Class ConnectionReleaseMode

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable

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

Field Summary

Modifier and TypeField and Description
public static final ConnectionReleaseMode
AFTER_STATEMENT

Indicates that JDBC connection should be aggressively released after each SQL statement is executed.

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

private String
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.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ConnectionReleaseMode

Returns:

The appropriate ConnectionReleaseMode instance
parse
(String
The release mode name.
modeName
)

Determine the correct ConnectionReleaseMode instance based on the given name.

private Object
public String

Returns:

The release mode name.
toString
()

Overrides java.lang.Object.toString.

Override of Object.toString().
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

AFTER_STATEMENTback to summary
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_TRANSACTIONback to summary
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.

nameback to summary
private String name
ON_CLOSEback to summary
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.

Constructor Detail

ConnectionReleaseModeback to summary
private ConnectionReleaseMode(String name)

Method Detail

parseback to summary
public static ConnectionReleaseMode parse(String modeName) throws HibernateException

Determine the correct ConnectionReleaseMode instance based on the given name.

Parameters
modeName:String

The release mode name.

Returns:ConnectionReleaseMode

The appropriate ConnectionReleaseMode instance

Exceptions
HibernateException:
Indicates the modeName param did not match any known modes.
readResolveback to summary
private Object readResolve()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Override of Object.toString(). Returns the release mode name.

Returns:String

The release mode name.