Package org.hibernate.testing.jdbc
Class SharedDriverManagerConnectionProviderImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
-
- org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl
-
- All Implemented Interfaces:
Serializable
,ConnectionValidator
,ConnectionProvider
,Service
,Configurable
,ServiceRegistryAwareService
,Stoppable
,Wrapped
public class SharedDriverManagerConnectionProviderImpl extends DriverManagerConnectionProviderImpl
A special connection provider that is shared across test runs for better performance.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
DriverManagerConnectionProviderImpl.PooledConnections
-
-
Field Summary
-
Fields inherited from class org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
CONNECTION_CREATOR_FACTORY, INIT_SQL, INITIAL_SIZE, MIN_SIZE, VALIDATION_INTERVAL
-
Fields inherited from interface org.hibernate.engine.jdbc.connections.internal.ConnectionValidator
ALWAYS_VALID
-
-
Constructor Summary
Constructors Constructor Description SharedDriverManagerConnectionProviderImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearTypeCache()
void
configure(Map<String,Object> configurationValues)
Configure the service.static SharedDriverManagerConnectionProviderImpl
getInstance()
int
getOpenConnections()
boolean
isValid(Connection connection)
Checks if the given connection is still valid.void
onDefaultTimeZoneChange()
void
reset()
void
stop()
Stop phase notification-
Methods inherited from class org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
closeConnection, finalize, getConnection, getConnectionProperties, getDatabaseConnectionInfo, injectServices, isUnwrappableAs, releasePooledConnections, supportsAggressiveRelease, unwrap, validateConnections, validateConnectionsReturned
-
-
-
-
Method Detail
-
getInstance
public static SharedDriverManagerConnectionProviderImpl getInstance()
-
configure
public void configure(Map<String,Object> configurationValues)
Description copied from interface:Configurable
Configure the service.- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDriverManagerConnectionProviderImpl
- Parameters:
configurationValues
- The configuration properties.
-
isValid
public boolean isValid(Connection connection) throws SQLException
Description copied from interface:ConnectionValidator
Checks if the given connection is still valid.- Specified by:
isValid
in interfaceConnectionValidator
- Overrides:
isValid
in classDriverManagerConnectionProviderImpl
- Returns:
true
if the connection is valid,false
otherwise- Throws:
SQLException
- when an error happens due to the connection usage leading to a connection close
-
stop
public void stop()
Description copied from interface:Stoppable
Stop phase notification- Specified by:
stop
in interfaceStoppable
- Overrides:
stop
in classDriverManagerConnectionProviderImpl
-
clearTypeCache
public void clearTypeCache()
-
onDefaultTimeZoneChange
public void onDefaultTimeZoneChange()
-
reset
public void reset()
-
getOpenConnections
public int getOpenConnections()
- Overrides:
getOpenConnections
in classDriverManagerConnectionProviderImpl
-
-