Skip to content

Santhosh Ponnam

Technology Blog

  • Home
  • About
  • Technology
    • Java
    • ORM
  • Privacy Policy
  • Toggle search form
  • Why to have a private constructor? Java
  • Log4J (RCE) Vulnerability Java
  • hashCode and equals methods in java Java
  • Unique Random ‘N’ digit Number generator Java
  • HikariCP Connection Pooling for Spring Boot for 1.x version Spring Boot
  • Windows Commands – kill port number Installations and Configurations
  • Another Log4j Bug – DoS Java
  • JPA vs Hibernate – Specification Vs Implementation ORM

HikariCP Configurations – Database Connection Pooling

Posted on November 8, 2020November 18, 2021 By Santhosh Ponnam

For the Hikari connection pool configuration, we enable it by using spring.datasource.type and assigning it fully qualified name of the connection pool implementation in application.properties file as following.

spring.datasource.type = com.zaxxer.hikari.HikariDataSource

If we are using Spring Boot 2.0 and onwards, Spring Boot selects HikariDataSource by default and we need not to configure above line. Now to configure Hikari specific connection pool settings, Spring Boot provides spring.datasource.hikari.* prefix to be used in application.properties file. We will discuss here some frequently used configurations.

1. connectionTimeout
connectionTimeout is the maximum number of milliseconds that a client will wait for a connection from connection pool. We need to configure it as following.

spring.datasource.hikari.connection-timeout=20000

2. minimumIdle
minimumIdle is the minimum number of idle connections that is maintained by HikariCP in connection pool. It is configured as following.

spring.datasource.hikari.minimum-idle=5

3. maximumPoolSize
maximumPoolSize configures the maximum pool size. It is configured as following.

spring.datasource.hikari.maximum-pool-size=12

4. idleTimeout
idleTimeout is the maximum amount of time in milliseconds that a connection is allowed to sit idle in connection pool. It is configured as following.

spring.datasource.hikari.idle-timeout=300000

5. maxLifetime
maxLifetime is the maximum life time in milliseconds of a connection in pool after it is closed. It is configured as following.

spring.datasource.hikari.max-lifetime=1200000

An in-use connection will never be retired, only when it is closed will it then be removed after maximum lifetime.


6. autoCommit
autoCommit configures the default auto-commit behaviour of connections returned from pool. Default value is true.

spring.datasource.hikari.auto-commit=true

Installations and Configurations, Spring Boot HikariCP Connection Pooling Tags:Configurations, Connection Pooling, HikariCP, Spring Boot

Post navigation

Previous Post: HikariCP Connection Pooling for Spring Boot for 1.x version
Next Post: Sonar Qube – Code Coverage and Code Quality Tool

Related Posts

  • Windows Commands – kill port number Installations and Configurations
  • Sonar Qube – Code Coverage and Code Quality Tool Installations and Configurations
  • HikariCP Connection Pooling for Spring Boot for 1.x version Spring Boot
  • Consent Management – DPDP Spring Boot HikariCP Connection Pooling

Recent Posts

  • Consent Management – DPDP
  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • June 2025
  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016

Recent Posts

  • Consent Management – DPDP
  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • June 2025
  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016




Recent Posts

  • Consent Management – DPDP
  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling
  • Another Log4j Bug – DoS Java
  • Windows Commands – kill port number Installations and Configurations
  • Why to have a private constructor? Java
  • hashCode and equals methods in java Java
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team Java
  • JPA vs Hibernate – Specification Vs Implementation ORM
  • Consent Management – DPDP Spring Boot HikariCP Connection Pooling
  • Sonar Qube – Code Coverage and Code Quality Tool Installations and Configurations

Copyright © 2025 Santhosh Ponnam.

Powered by PressBook News WordPress theme