Package org.hibernate
Class ConnectionReleaseMode
java.lang.Object
org.hibernate.ConnectionReleaseMode
- All Implemented Interfaces:
Serializable
Defines the various policies by which Hibernate might release its underlying
JDBC connection.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConnectionReleaseModeIndicates that JDBC connection should be aggressively released after each SQL statement is executed.static final ConnectionReleaseModeIndicates that JDBC connections should be released after each transaction ends (works with both JTA-registered synch and HibernateTransaction API).static final ConnectionReleaseModeIndicates 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
Modifier and TypeMethodDescriptionstatic ConnectionReleaseModeDetermine the correct ConnectionReleaseMode instance based on the given name.toString()Override of Object.toString().
-
Field Details
-
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
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
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 Details
-
toString
Override of Object.toString(). Returns the release mode name. -
parse
Determine the correct ConnectionReleaseMode instance based on the given name.- Parameters:
modeName- The release mode name.- Returns:
- The appropriate ConnectionReleaseMode instance
- Throws:
HibernateException- Indicates the modeName param did not match any known modes.
-