public class DefaultSqlClientPool extends SqlClientPool
Pool
. The Pool
itself is backed by an instance of Vertx
obtained via the VertxInstance
service. Configuration of the Pool
is handled by the SqlClientPoolConfiguration
service. This class may be extended by programs which wish to implement custom connection management or multitenancy.
The lifecycle of this pool is managed by Hibernate Reactive: it is created when the reactive org.hibernate.SessionFactory
is created and destroyed when the SessionFactory
is destroyed. For cases where the underlying Pool
lifecycle is managed externally to Hibernate, use ExternalSqlClientPool
.
SqlClientPoolConfiguration
Constructor and Description |
---|
DefaultSqlClientPool() |
Modifier and Type | Method and Description |
---|---|
void | configure(Map configuration) |
protected Pool | createPool(URI uri) Create a new Pool for the given JDBC URL or database URI, using the VertxInstance service to obtain an instance of Vertx , and the SqlClientPoolConfiguration service to obtain options for creating the connection pool. |
protected Pool | createPool(URI uri, SqlConnectOptions connectOptions, PoolOptions poolOptions, Vertx vertx) Create a new Pool for the given JDBC URL or database URI, connection pool options, and the given instance of Vertx . |
protected Pool | getPool() |
protected SqlStatementLogger | getSqlStatementLogger() |
void | injectServices(ServiceRegistryImplementor serviceRegistry) |
protected URI | jdbcUrl(Map<?,?> configurationValues) Determine the JDBC URL or database URI from the given configuration. |
static URI | parse(String url) |
void | start() |
void | stop() |
protected boolean | usePostgresStyleParameters() |
getConnection, getConnection, getProxyConnection, getProxyConnection, getTenantPool
public void injectServices(ServiceRegistryImplementor serviceRegistry)
public void configure(Map configuration)
public void start()
protected Pool getPool()
getPool
in class SqlClientPool
Pool
protected SqlStatementLogger getSqlStatementLogger()
getSqlStatementLogger
in class SqlClientPool
SqlStatementLogger
for logging SQL statements as they are executedprotected boolean usePostgresStyleParameters()
usePostgresStyleParameters
in class SqlClientPool
protected Pool createPool(URI uri)
Pool
for the given JDBC URL or database URI, using the VertxInstance
service to obtain an instance of Vertx
, and the SqlClientPoolConfiguration
service to obtain options for creating the connection pool.uri
- JDBC URL or database URIPool
protected Pool createPool(URI uri, SqlConnectOptions connectOptions, PoolOptions poolOptions, Vertx vertx)
Pool
for the given JDBC URL or database URI, connection pool options, and the given instance of Vertx
.uri
- JDBC URL or database URIconnectOptions
- the connection optionspoolOptions
- the connection pooling optionsvertx
- the instance of Vertx
to be used by the poolPool
protected URI jdbcUrl(Map<?,?> configurationValues)
configurationValues
- the configuration propertiesURI
public void stop()