public class HostConnectionProvider extends Object implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
HostConnectionProvider delegates all JDBC connection handling to the host application's
ConnectionProvider, so that the short-lived SessionFactory used to generate the
event tables borrows connections from the very same pool as the application.
Crucially, it deliberately does not implement Stoppable.
When the temporary schema-generation ServiceRegistry is destroyed, Hibernate only calls
stop() on Stoppable services, so the host connection pool is never closed by us.
| Constructor and Description |
|---|
HostConnectionProvider(org.hibernate.engine.jdbc.connections.spi.ConnectionProvider delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection(Connection connection) |
Connection |
getConnection() |
boolean |
isUnwrappableAs(Class unwrapType) |
boolean |
supportsAggressiveRelease() |
<T> T |
unwrap(Class<T> unwrapType) |
public HostConnectionProvider(org.hibernate.engine.jdbc.connections.spi.ConnectionProvider delegate)
public Connection getConnection() throws SQLException
getConnection in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProviderSQLExceptionpublic void closeConnection(Connection connection) throws SQLException
closeConnection in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProviderSQLExceptionpublic boolean supportsAggressiveRelease()
supportsAggressiveRelease in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProviderpublic boolean isUnwrappableAs(Class unwrapType)
isUnwrappableAs in interface org.hibernate.service.spi.Wrappedpublic <T> T unwrap(Class<T> unwrapType)
unwrap in interface org.hibernate.service.spi.WrappedCopyright © 2026. All rights reserved.