Package org.hibernate.connection
Class UserSuppliedConnectionProvider
java.lang.Object
org.hibernate.connection.UserSuppliedConnectionProvider
- All Implemented Interfaces:
ConnectionProvider
An implementation of the ConnectionProvider interface that
simply throws an exception when a connection is requested. This implementation
indicates that the user is expected to supply a JDBC connection.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release all resources held by this provider.voidcloseConnection(Connection conn) Dispose of a used connection.voidconfigure(Properties props) Initialize the connection provider from given properties.Grab a connection, with the autocommit mode specified by hibernate.connection.autocommit.booleanDoes this connection provider support aggressive release of JDBC connections and re-acquistion of those connections (if need be) later?
-
Constructor Details
-
UserSuppliedConnectionProvider
public UserSuppliedConnectionProvider()
-
-
Method Details
-
configure
Description copied from interface:ConnectionProviderInitialize the connection provider from given properties.- Specified by:
configurein interfaceConnectionProvider- Parameters:
props- SessionFactory properties- Throws:
HibernateException- See Also:
-
getConnection
Description copied from interface:ConnectionProviderGrab a connection, with the autocommit mode specified by hibernate.connection.autocommit.- Specified by:
getConnectionin interfaceConnectionProvider- Returns:
- a JDBC connection
- See Also:
-
closeConnection
Description copied from interface:ConnectionProviderDispose of a used connection.- Specified by:
closeConnectionin interfaceConnectionProvider- Parameters:
conn- a JDBC connection- See Also:
-
close
public void close()Description copied from interface:ConnectionProviderRelease all resources held by this provider. JavaDoc requires a second sentence.- Specified by:
closein interfaceConnectionProvider
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()Description copied from interface:ConnectionProviderDoes this connection provider support aggressive release of JDBC connections and re-acquistion of those connections (if need be) later? This is used in conjunction withto aggressively release JDBC connections. However, the configured ConnectionProvider must support re-acquisition of the same underlying connection for that semantic to work. Typically, this is only true in managed environments where a container tracks connections by transaction or thread. Note that JTA semantic depends on the fact that the underlying connection provider does support aggressive release.invalid reference
org.hibernate.cfg.Environment.RELEASE_CONNECTIONS- Specified by:
supportsAggressiveReleasein interfaceConnectionProvider- See Also:
-