Interface HikariDataSourceConfig
- All Superinterfaces:
ConnectionConfig
,NamedService
,Prototype.Api
,ProviderConfig
- All Known Implementing Classes:
HikariDataSourceConfig.BuilderBase.HikariDataSourceConfigImpl
Hikari connection pool specific configuration for
DataSource
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Fluent API builder forHikariDataSourceConfig
.static class
HikariDataSourceConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig> Fluent API builder base forHikariDataSourceConfig
. -
Method Summary
Modifier and TypeMethodDescriptionSet whether pool suspension is allowed.Set the default auto-commit behavior of connections in the pool.builder()
Create a new fluent API builder to customize configuration.builder
(HikariDataSourceConfig instance) Create a new fluent API builder from an existing instance.catalog()
Set the default catalog name to be set on connections.Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool.Set the SQL query to be executed to test the validity of connections.Set the maximum number of milliseconds that a client will wait for a connection from the pool.static HikariDataSourceConfig
create()
Create a new instance with default values.static HikariDataSourceConfig
Deprecated.static HikariDataSourceConfig
Create a new instance from configuration.Add properties (name/value pair) that will be used to configure the connection pool health check.This property controls the maximum amount of time that a connection is allowed to sit idle in the pool.Set the pool initialization failure timeout.Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback()
.This property controls the keepalive interval for a connection in the pool.This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.This property controls the maximum lifetime of a connection in the pool.The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections.name()
Name of this provider.poolName()
Set the name of the connection pool.Add properties (name/value pair) that will be used to configure the DataSource/Driver.readOnly()
Configures the Connections to be added to the pool as read-only Connections.Configures whether HikariCP self-registers theHikariConfigMXBean
andHikariPoolMXBean
in JMX.schema()
Set the default schema name to be set on connections.Set the default transaction isolation level.default String
type()
Type of this provider.Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.Methods inherited from interface io.helidon.data.sql.common.ConnectionConfig
jdbcDriverClassName, password, url, username
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Deprecated.Create a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
name
String name()Name of this provider.- Specified by:
name
in interfaceNamedService
- Returns:
- the provider name
-
allowPoolSuspension
Set whether pool suspension is allowed. SeeHikariConfig.setAllowPoolSuspension(boolean)
for details.- Returns:
- the desired pool suspension allowance
-
autoCommit
Set the default auto-commit behavior of connections in the pool. SeeHikariConfig.setAutoCommit(boolean)
for details.- Returns:
- the desired auto-commit default for connections
-
catalog
Set the default catalog name to be set on connections. SeeHikariConfig.setCatalog(String)
for details.- Returns:
- the default catalog name
-
connectionInitSql
Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool. SeeHikariConfig.setConnectionInitSql(String)
for details.- Returns:
- the SQL to execute on new connections
-
connectionTestQuery
Set the SQL query to be executed to test the validity of connections. SeeHikariConfig.setConnectionTestQuery(String)
for details.- Returns:
- a SQL query string
-
connectionTimeout
Set the maximum number of milliseconds that a client will wait for a connection from the pool. SeeHikariConfig.setConnectionTimeout(long)
for details.- Returns:
- the connection timeout in milliseconds
-
healthCheckProperties
Add properties (name/value pair) that will be used to configure the connection pool health check. SeeHikariConfig.addHealthCheckProperty(String, String)
for details.- Returns:
- the health check properties
-
idleTimeout
This property controls the maximum amount of time that a connection is allowed to sit idle in the pool. SeeHikariConfig.setIdleTimeout(long)
for details.- Returns:
- the idle timeout in milliseconds
-
initializationFailTimeout
Set the pool initialization failure timeout. SeeHikariConfig.setInitializationFailTimeout(long)
for details.- Returns:
- the number of milliseconds before the pool initialization fails, or
0
to validate connection setup but continue with pool start, or less than zero to skip all initialization checks and start the pool without delay
-
isolateInternalQueries
Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback()
. SeeHikariConfig.setIsolateInternalQueries(boolean)
for details.- Returns:
true
if internal pool queries should be isolated,false
if not
-
keepaliveTime
This property controls the keepalive interval for a connection in the pool. SeeHikariConfig.setKeepaliveTime(long)
for details.- Returns:
- the interval in which connections will be tested for aliveness, thus keeping them alive by the act of checking. Value is in milliseconds.
-
leakDetectionThreshold
This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. SeeHikariConfig.setLeakDetectionThreshold(long)
for details.- Returns:
- the connection leak detection threshold in milliseconds
-
maximumPoolSize
The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. SeeHikariConfig.setMaximumPoolSize(int)
for details.- Returns:
- the maximum number of connections in the pool
-
maxLifetime
This property controls the maximum lifetime of a connection in the pool. SeeHikariConfig.setMaxLifetime(long)
for details.- Returns:
- the maximum connection lifetime in milliseconds
-
minimumIdle
The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. SeeHikariConfig.setMinimumIdle(int)
for details.- Returns:
- the minimum number of idle connections in the pool to maintain
-
poolName
Set the name of the connection pool. SeeHikariConfig.setPoolName(String)
for details.- Returns:
- the name of the connection pool
-
readOnly
Configures the Connections to be added to the pool as read-only Connections. SeeHikariConfig.setReadOnly(boolean)
for details.- Returns:
true
if the Connections in the pool are read-only,false
if not
-
registerMbeans
Configures whether HikariCP self-registers theHikariConfigMXBean
andHikariPoolMXBean
in JMX. SeeHikariConfig.setRegisterMbeans(boolean)
for details.- Returns:
true
if HikariCP should register MXBeans,false
if it should not
-
schema
Set the default schema name to be set on connections. SeeHikariConfig.setSchema(String)
for details.- Returns:
- the name of the default schema
-
transactionIsolation
Optional<TransactionIsolation> transactionIsolation()Set the default transaction isolation level. SeeHikariConfig.setTransactionIsolation(String)
for details.- Returns:
- the isolation level
-
validationTimeout
Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive. SeeHikariConfig.setValidationTimeout(long)
for details.- Returns:
- the validation timeout in milliseconds
-
properties
Add properties (name/value pair) that will be used to configure the DataSource/Driver. Property values are limited toString
values. SeeHikariConfig.addDataSourceProperty(String, Object)
for details.- Returns:
- the properties
-
type
Type of this provider.- Specified by:
type
in interfaceNamedService
- Returns:
- the provider type - "hikari"
-
create(io.helidon.config.Config)