Package org.hibernate.reactive.pool
Interface ReactiveConnectionPool
-
- All Superinterfaces:
Serializable
,Service
@Incubating public interface ReactiveConnectionPool extends Service
A HibernateService
that provides access to pooledreactive connections
.A custom implementation of
ReactiveConnectionPool
may be selected by setting the configuration propertySettings.SQL_CLIENT_POOL
.Alternatively, a program may integrate a custom
ReactiveConnectionPool
by contributing a new service using aStandardServiceInitiator
or from code-based Hibernate configuration by callingStandardServiceRegistryBuilder.addService(java.lang.Class<T>, T)
.new ReactiveServiceRegistryBuilder() .applySettings( properties ) .addService( ReactiveConnectionPool.class, new MyReactiveConnectionPool() ) .build();
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<Void>
getCloseFuture()
The shutdown of the pool is actually asynchronous but the core service registry won't return theCompletionStage
.CompletionStage<ReactiveConnection>
getConnection()
Obtain a reactive connection, returning the connection via aCompletionStage
.CompletionStage<ReactiveConnection>
getConnection(String tenantId)
Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
.CompletionStage<ReactiveConnection>
getConnection(String tenantId, SqlExceptionHelper sqlExceptionHelper)
Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool.CompletionStage<ReactiveConnection>
getConnection(SqlExceptionHelper sqlExceptionHelper)
Obtain a reactive connection, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool.
-
-
-
Method Detail
-
getConnection
CompletionStage<ReactiveConnection> getConnection()
Obtain a reactive connection, returning the connection via aCompletionStage
.
-
getConnection
CompletionStage<ReactiveConnection> getConnection(SqlExceptionHelper sqlExceptionHelper)
Obtain a reactive connection, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool.
-
getConnection
CompletionStage<ReactiveConnection> getConnection(String tenantId)
Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
.
-
getConnection
CompletionStage<ReactiveConnection> getConnection(String tenantId, SqlExceptionHelper sqlExceptionHelper)
Obtain a reactive connection for the given tenant id, returning the connection via aCompletionStage
and overriding the defaultSqlExceptionHelper
for the pool.
-
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.
-
-