Top Description Fields Constructors Methods
org.hibernate

public final Enum ConnectionReleaseMode

extends Enum<ConnectionReleaseMode>
Class Inheritance
Imports
java.util.Locale, org.hibernate.internal.util.StringHelper

Enumerates various policies for releasing JDBC connections. Complementary to ConnectionAcquisitionMode.
Author
Steve Ebersole
See Also
org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode

Field Summary

Modifier and TypeField and Description
public static final ConnectionReleaseMode
AFTER_STATEMENT

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

public static final ConnectionReleaseMode
AFTER_TRANSACTION

Indicates that the JDBC connection should be released after each transaction ends.

public static final ConnectionReleaseMode
BEFORE_TRANSACTION_COMPLETION

Indicates that the JDBC connection should be released before each transaction commits or rolls back.

public static final ConnectionReleaseMode
ON_CLOSE

Indicates that connections should only be released when the session is explicitly closed or disconnected.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ConnectionReleaseMode
interpret(Object setting)

public static ConnectionReleaseMode

Returns:

The matched enum value.
parse
(final String
The name to parse
name
)

Alias for ConnectionReleaseMode#valueOf(String) using uppercase version of the incoming name.

public static ConnectionReleaseMode
public static ConnectionReleaseMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AFTER_STATEMENTback to summary
public static final ConnectionReleaseMode 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.

AFTER_TRANSACTIONback to summary
public static final ConnectionReleaseMode 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.

BEFORE_TRANSACTION_COMPLETIONback to summary
public static final ConnectionReleaseMode 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.

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.

Prior to Hibernate 3.1, this was the default mode.

Constructor Detail

ConnectionReleaseModeback to summary
private ConnectionReleaseMode()

Method Detail

interpretback to summary
public static ConnectionReleaseMode interpret(Object setting)
parseback to summary
public static ConnectionReleaseMode parse(final String name)

Alias for ConnectionReleaseMode#valueOf(String) using uppercase version of the incoming name.

Parameters
name:String

The name to parse

Returns:ConnectionReleaseMode

The matched enum value.

valueOfback to summary
public static ConnectionReleaseMode valueOf(String name)
valuesback to summary
public static ConnectionReleaseMode[] values()