Package org.hibernate.reactive.pool
Interface ReactiveConnectionPool
- All Superinterfaces:
Serializable
,org.hibernate.service.Service
- All Known Implementing Classes:
DefaultSqlClientPool
,ExternalSqlClientPool
,SqlClientPool
@Incubating
public interface ReactiveConnectionPool
extends org.hibernate.service.Service
A Hibernate
Service
that provides access to pooled
reactive connections
.
A custom implementation of ReactiveConnectionPool
may be selected by setting the configuration property
Settings.SQL_CLIENT_POOL
.
Alternatively, a program may integrate a custom
ReactiveConnectionPool
by contributing a new service using
a StandardServiceInitiator
or from code-based Hibernate configuration by calling
StandardServiceRegistryBuilder.addService(java.lang.Class<T>, T)
.
new ReactiveServiceRegistryBuilder() .applySettings( properties ) .addService( ReactiveConnectionPool.class, new MyReactiveConnectionPool() ) .build();
-
Method Summary
Modifier and TypeMethodDescriptionThe shutdown of the pool is actually asynchronous but the core service registry won't return theCompletionStage
.Obtain a reactive connection, returning the connection via aCompletionStage
.getConnection
(String tenantId) Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
.getConnection
(String tenantId, org.hibernate.engine.jdbc.spi.SqlExceptionHelper sqlExceptionHelper) Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool.getConnection
(org.hibernate.engine.jdbc.spi.SqlExceptionHelper sqlExceptionHelper) Obtain a reactive connection, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool.selectJdbcOutsideTransaction
(String sql, Object[] paramValues)
-
Method Details
-
getConnection
CompletionStage<ReactiveConnection> getConnection()Obtain a reactive connection, returning the connection via aCompletionStage
. -
getConnection
CompletionStage<ReactiveConnection> getConnection(org.hibernate.engine.jdbc.spi.SqlExceptionHelper sqlExceptionHelper) Obtain a reactive connection, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool. -
getConnection
Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
. -
getConnection
CompletionStage<ReactiveConnection> getConnection(String tenantId, org.hibernate.engine.jdbc.spi.SqlExceptionHelper sqlExceptionHelper) Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool. -
selectJdbcOutsideTransaction
-
getCloseFuture
CompletionStage<Void> getCloseFuture()The shutdown of the pool is actually asynchronous but the core service registry won't return theCompletionStage
. If you need to wait for the underlying pool to be closed, after closing the SessionFactory you can get the CompletionStage instance from this getter.
-