Package org.hibernate.internal
Class ContextualJdbcConnectionAccess
- java.lang.Object
-
- org.hibernate.internal.ContextualJdbcConnectionAccess
-
- All Implemented Interfaces:
Serializable
,JdbcConnectionAccess
public class ContextualJdbcConnectionAccess extends Object implements JdbcConnectionAccess, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContextualJdbcConnectionAccess(String tenantIdentifier, SessionEventListener listener, MultiTenantConnectionProvider connectionProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
obtainConnection()
Obtain a JDBC connectionvoid
releaseConnection(Connection connection)
Release a previously obtained connectionboolean
supportsAggressiveRelease()
Does the underlying provider of connections support aggressive releasing of connections (and re-acquisition of those connections later, if need be) in JTA environments?
-
-
-
Constructor Detail
-
ContextualJdbcConnectionAccess
public ContextualJdbcConnectionAccess(String tenantIdentifier, SessionEventListener listener, MultiTenantConnectionProvider connectionProvider)
-
-
Method Detail
-
obtainConnection
public Connection obtainConnection() throws SQLException
Description copied from interface:JdbcConnectionAccess
Obtain a JDBC connection- Specified by:
obtainConnection
in interfaceJdbcConnectionAccess
- Returns:
- The obtained connection
- Throws:
SQLException
- Indicates a problem getting the connection
-
releaseConnection
public void releaseConnection(Connection connection) throws SQLException
Description copied from interface:JdbcConnectionAccess
Release a previously obtained connection- Specified by:
releaseConnection
in interfaceJdbcConnectionAccess
- Parameters:
connection
- The connection to release- Throws:
SQLException
- Indicates a problem releasing the connection
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
Description copied from interface:JdbcConnectionAccess
Does the underlying provider of connections support aggressive releasing of connections (and re-acquisition of those connections later, if need be) in JTA environments?- Specified by:
supportsAggressiveRelease
in interfaceJdbcConnectionAccess
- Returns:
- true/false
- See Also:
ConnectionProvider.supportsAggressiveRelease()
,MultiTenantConnectionProvider.supportsAggressiveRelease()
-
-