@ -69,11 +69,11 @@ AKA ["What you probably didn't know about connection pool sizing"](https://githu
#### Configuration (knobs, baby!)
HikariCP comes with *sane* defaults that perform well in most deployments without additional tweaking. **Every property is optional, except for the "essentials" marked below.**
<sup>:paperclip:</sup> *HikariCP uses milliseconds for all time values.*
<sup>📎</sup> *HikariCP uses milliseconds for all time values.*
##### Essentials
:abc:``dataSourceClassName``<br/>
🔠``dataSourceClassName``<br/>
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.
Note XA data sources are not supported. XA requires a real transaction manager like
@ -83,7 +83,7 @@ Note XA data sources are not supported. XA requires a real transaction manager
*- or -*
:abc:``jdbcUrl``<br/>
🔠``jdbcUrl``<br/>
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
little significant difference. When using this property with "old" drivers, you may also need to set
@ -94,7 +94,7 @@ specified in the URL itself.
***
:abc:``username``<br/>
🔠``username``<br/>
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
calling ``DataSource.getConnection(*username*, password)`` on the underlying DataSource. However,
@ -104,7 +104,7 @@ driver's ``DriverManager.getConnection(jdbcUrl, props)`` call. If this is not w
skip this method entirely and call ``addDataSourceProperty("username", ...)``, for example.
*Default: none*
:abc:``password``<br/>
🔠``password``<br/>
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
calling ``DataSource.getConnection(username, *password*)`` on the underlying DataSource. However,
@ -116,25 +116,25 @@ skip this method entirely and call ``addDataSourceProperty("pass", ...)``, for e
##### Frequently used
:white_check_mark:``autoCommit``<br/>
✅``autoCommit``<br/>
This property controls the default auto-commit behavior of connections returned from the pool.
It is a boolean value.
*Default: true*
:watch:``connectionTimeout``<br/>
⌚``connectionTimeout``<br/>
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
available, a SQLException will be thrown. 100ms is the minimum value.
*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
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*
this timeout. A value of 0 means that idle connections are never removed from the pool.
*Default: 600000 (10 minutes)*
:watch:``maxLifetime``<br/>
⌚``maxLifetime``<br/>
This property controls the maximum lifetime of a connection in the pool. When a connection
reaches this timeout it will be retired from the pool, subject to a maximum variation of +30
seconds. An in-use connection will never be retired, only when it is closed will it then be
@ -143,7 +143,7 @@ than any database-level connection timeout.** A value of 0 indicates no maximum
(infinite lifetime), subject of course to the ``idleTimeout`` setting.
*Default: 1800000 (30 minutes)*
:abc:``connectionTestQuery``<br/>
🔠``connectionTestQuery``<br/>
**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
will be executed just before a connection is given to you from the pool to validate that the
@ -151,7 +151,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.*
*Default: none*
:hash:``minimumIdle``<br/>
🔢``minimumIdle``<br/>
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
add additional connections quickly and efficiently. However, for maximum performance and
@ -159,7 +159,7 @@ responsiveness to spike demands, we recommend *not* setting this value and inste
HikariCP to act as a *fixed size* connection pool.
*Default: same as maximumPoolSize*
:hash:``maximumPoolSize``<br/>
🔢``maximumPoolSize``<br/>
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
actual connections to the database backend. A reasonable value for this is best determined
@ -168,27 +168,27 @@ available, calls to getConnection() will block for up to ``connectionTimeout`` m
before timing out.
*Default: 10*
:chart_with_upwards_trend:``metricRegistry``<br/>
📈``metricRegistry``<br/>
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
pool to record various metrics. See the [Metrics](https://github.com/brettwooldridge/HikariCP/wiki/Codahale-Metrics)
wiki page for details.
*Default: none*
:abc:``poolName``<br/>
🔠``poolName``<br/>
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.
*Default: auto-generated*
##### 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
initial connections successfully. If you want your application to start *even when* the
database is down/unavailable, set this property to ``false``.