public interface ReactiveConnectionPool
extends org.hibernate.service.Service
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
ReactiveServiceRegistryBuilder.addService(java.lang.Class, org.hibernate.service.Service).
new ReactiveServiceRegistryBuilder()
.applySettings( properties )
.addService( ReactiveConnectionPool.class, new MyReactiveConnectionPool() )
.build();
| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Void> |
getCloseFuture()
The shutdown of the pool is actually asynchronous but the
core service registry won't return the
CompletionStage. |
CompletionStage<ReactiveConnection> |
getConnection()
Obtain a reactive connection, returning the connection
via a
CompletionStage. |
CompletionStage<ReactiveConnection> |
getConnection(String tenantId)
Obtain a reactive connection for the given tenant id,
returning the connection via a
CompletionStage. |
ReactiveConnection |
getProxyConnection()
Obtain a lazily-initializing reactive connection.
|
ReactiveConnection |
getProxyConnection(String tenantId)
Obtain a lazily-initializing reactive connection for the
given tenant id.
|
CompletionStage<ReactiveConnection> getConnection()
CompletionStage.CompletionStage<ReactiveConnection> getConnection(String tenantId)
CompletionStage.ReactiveConnection getProxyConnection()
ReactiveConnection is first used.ReactiveConnection getProxyConnection(String tenantId)
ReactiveConnection is
first used.CompletionStage<Void> getCloseFuture()
CompletionStage.
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.Copyright © 2020-2022 Red Hat, Inc. All Rights Reserved.