@ -72,7 +72,7 @@ HikariCP comes with *sane* defaults that perform well in most deployments withou
##### Essentials
##### Essentials
:abc:``dataSourceClassName``<br/>
🔠``dataSourceClassName``<br/>
This is the name of the ``DataSource`` class provided by the JDBC driver. Consult the
This is the name of the ``DataSource`` class provided by the JDBC driver. Consult the
documentation for your specific JDBC driver to get this class name, or see the [table](https://github.com/brettwooldridge/HikariCP#popular-datasource-class-names) below.
documentation for your specific JDBC driver to get this class name, or see the [table](https://github.com/brettwooldridge/HikariCP#popular-datasource-class-names) below.
Note XA data sources are not supported. XA requires a real transaction manager like
Note XA data sources are not supported. XA requires a real transaction manager like
@ -82,7 +82,7 @@ Note XA data sources are not supported. XA requires a real transaction manager
*- or -*
*- or -*
:abc:``jdbcUrl``<br/>
🔠``jdbcUrl``<br/>
This property directs HikariCP to use "DriverManager-based" configuration. We feel that DataSource-based
This property directs HikariCP to use "DriverManager-based" configuration. We feel that DataSource-based
configuration (above) is superior for a variety of reasons (see below), but for many deployments there is
configuration (above) is superior for a variety of reasons (see below), but for many deployments there is
little significant difference. When using this property with "old" drivers, you may also need to set
little significant difference. When using this property with "old" drivers, you may also need to set
@ -93,7 +93,7 @@ specified in the URL itself.
***
***
:abc:``username``<br/>
🔠``username``<br/>
This property sets the default authentication username used when obtaining *Connections* from
This property sets the default authentication username used when obtaining *Connections* from
the underlying driver. Note that for DataSources this works in a very deterministic fashion by
the underlying driver. Note that for DataSources this works in a very deterministic fashion by
calling ``DataSource.getConnection(*username*, password)`` on the underlying DataSource. However,
calling ``DataSource.getConnection(*username*, password)`` on the underlying DataSource. However,
@ -103,7 +103,7 @@ driver's ``DriverManager.getConnection(jdbcUrl, props)`` call. If this is not w
skip this method entirely and call ``addDataSourceProperty("username", ...)``, for example.
skip this method entirely and call ``addDataSourceProperty("username", ...)``, for example.
*Default: none*
*Default: none*
:abc:``password``<br/>
🔠``password``<br/>
This property sets the default authentication password used when obtaining *Connections* from
This property sets the default authentication password used when obtaining *Connections* from
the underlying driver. Note that for DataSources this works in a very deterministic fashion by
the underlying driver. Note that for DataSources this works in a very deterministic fashion by
calling ``DataSource.getConnection(username, *password*)`` on the underlying DataSource. However,
calling ``DataSource.getConnection(username, *password*)`` on the underlying DataSource. However,
@ -115,25 +115,25 @@ skip this method entirely and call ``addDataSourceProperty("pass", ...)``, for e
##### Frequently used
##### Frequently used
:white_check_mark:``autoCommit``<br/>
✅``autoCommit``<br/>
This property controls the default auto-commit behavior of connections returned from the pool.
This property controls the default auto-commit behavior of connections returned from the pool.
It is a boolean value.
It is a boolean value.
*Default: true*
*Default: true*
:watch:``connectionTimeout``<br/>
⌚``connectionTimeout``<br/>
This property controls the maximum number of milliseconds that a client (that's you) will wait
This property controls the maximum number of milliseconds that a client (that's you) will wait
for a connection from the pool. If this time is exceeded without a connection becoming
for a connection from the pool. If this time is exceeded without a connection becoming
available, a SQLException will be thrown. 100ms is the minimum value.
available, a SQLException will be thrown. 100ms is the minimum value.
*Default: 30000 (30 seconds)*
*Default: 30000 (30 seconds)*
:watch:``idleTimeout``<br/>
⌚``idleTimeout``<br/>
This property controls the maximum amount of time that a connection is allowed to sit idle in the
This property controls the maximum amount of time that a connection is allowed to sit idle in the
pool. Whether a connection is retired as idle or not is subject to a maximum variation of +30
pool. Whether a connection is retired as idle or not is subject to a maximum variation of +30
seconds, and average variation of +15 seconds. A connection will never be retired as idle *before*
seconds, and average variation of +15 seconds. A connection will never be retired as idle *before*
this timeout. A value of 0 means that idle connections are never removed from the pool.
this timeout. A value of 0 means that idle connections are never removed from the pool.
*Default: 600000 (10 minutes)*
*Default: 600000 (10 minutes)*
:watch:``maxLifetime``<br/>
⌚``maxLifetime``<br/>
This property controls the maximum lifetime of a connection in the pool. When a connection
This property controls the maximum lifetime of a connection in the pool. When a connection
reaches this timeout, even if recently used, it will be retired from the pool. An in-use
reaches this timeout, even if recently used, it will be retired from the pool. An in-use
connection will never be retired, only when it is idle will it be removed. We strongly
connection will never be retired, only when it is idle will it be removed. We strongly
@ -142,7 +142,7 @@ value of 0 indicates no maximum lifetime (infinite lifetime), subject of course
``idleTimeout`` setting.
``idleTimeout`` setting.
*Default: 1800000 (30 minutes)*
*Default: 1800000 (30 minutes)*
:abc:``connectionTestQuery``<br/>
🔠``connectionTestQuery``<br/>
**If your driver supports JDBC4 we strongly recommend not setting this property.** This is for
**If your driver supports JDBC4 we strongly recommend not setting this property.** This is for
"legacy" databases that do not support the JDBC4 ``Connection.isValid() API``. This is the query that
"legacy" databases that do not support the JDBC4 ``Connection.isValid() API``. This is the query that
will be executed just before a connection is given to you from the pool to validate that the
will be executed just before a connection is given to you from the pool to validate that the
@ -150,7 +150,7 @@ connection to the database is still alive. *Again, try running the pool without
HikariCP will log an error if your driver is not JDBC4 compliant to let you know.*
HikariCP will log an error if your driver is not JDBC4 compliant to let you know.*
*Default: none*
*Default: none*
:hash:``minimumIdle``<br/>
🔢``minimumIdle``<br/>
This property controls the minimum number of *idle connections* that HikariCP tries to maintain
This property controls the minimum number of *idle connections* that HikariCP tries to maintain
in the pool. If the idle connections dip below this value, HikariCP will make a best effort to
in the pool. If the idle connections dip below this value, HikariCP will make a best effort to
add additional connections quickly and efficiently. However, for maximum performance and
add additional connections quickly and efficiently. However, for maximum performance and
@ -158,7 +158,7 @@ responsiveness to spike demands, we recommend *not* setting this value and inste
HikariCP to act as a *fixed size* connection pool.
HikariCP to act as a *fixed size* connection pool.
*Default: same as maximumPoolSize*
*Default: same as maximumPoolSize*
:hash:``maximumPoolSize``<br/>
🔢``maximumPoolSize``<br/>
This property controls the maximum size that the pool is allowed to reach, including both
This property controls the maximum size that the pool is allowed to reach, including both
idle and in-use connections. Basically this value will determine the maximum number of
idle and in-use connections. Basically this value will determine the maximum number of
actual connections to the database backend. A reasonable value for this is best determined
actual connections to the database backend. A reasonable value for this is best determined
@ -167,69 +167,69 @@ available, calls to getConnection() will block for up to ``connectionTimeout`` m
before timing out.
before timing out.
*Default: 10*
*Default: 10*
:chart_with_upwards_trend:``metricRegistry``<br/>
📈``metricRegistry``<br/>
This property is only available via programmatic configuration or IoC container. This property
This property is only available via programmatic configuration or IoC container. This property
allows you to specify an instance of a *Codahale/Dropwizard* ``MetricRegistry`` to be used by the
allows you to specify an instance of a *Codahale/Dropwizard* ``MetricRegistry`` to be used by the
pool to record various metrics. See the [Metrics](https://github.com/brettwooldridge/HikariCP/wiki/Codahale-Metrics)
pool to record various metrics. See the [Metrics](https://github.com/brettwooldridge/HikariCP/wiki/Codahale-Metrics)
wiki page for details.
wiki page for details.
*Default: none*
*Default: none*
:abc:``poolName``<br/>
🔠``poolName``<br/>
This property represents a user-defined name for the connection pool and appears mainly
This property represents a user-defined name for the connection pool and appears mainly
in logging and JMX management consoles to identify pools and pool configurations.
in logging and JMX management consoles to identify pools and pool configurations.
*Default: auto-generated*
*Default: auto-generated*
##### Infrequently used
##### Infrequently used
:white_check_mark:``initializationFailFast``<br/>
✅``initializationFailFast``<br/>
This property controls whether the pool will "fail fast" if the pool cannot be seeded with
This property controls whether the pool will "fail fast" if the pool cannot be seeded with
initial connections successfully. This property has no effect if ``minimumIdle`` is 0. If you
initial connections successfully. This property has no effect if ``minimumIdle`` is 0. If you
want your application to start *even when* the database is down/unavailable, set this property
want your application to start *even when* the database is down/unavailable, set this property