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
A special connection provider that is shared across test runs for better performance.
- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Configure the service.int
boolean
isValid
(Connection connection) Checks if the given connection is still valid.void
void
reset()
void
stop()
Stop phase notificationMethods inherited from class org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
closeConnection, finalize, getConnection, getConnectionProperties, getDatabaseConnectionInfo, injectServices, isUnwrappableAs, releasePooledConnections, supportsAggressiveRelease, unwrap, validateConnections, validateConnectionsReturned
-
Constructor Details
-
SharedDriverManagerConnectionProviderImpl
public SharedDriverManagerConnectionProviderImpl()
-
-
Method Details
-
getInstance
-
configure
Description copied from interface:Configurable
Configure the service.- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDriverManagerConnectionProviderImpl
- Parameters:
configurationValues
- The configuration properties.
-
isValid
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
-