Search code examples
connection-poolinghikaricpautocommit

Reset (autoCommit) on connection in HikariCP


I keep seeing this log when I use connections in Hikari pool.

[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314
[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314
[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314
[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314
[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314
[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314
[com.zaxxer.hikari.pool.PoolElf] : HikariPool-0 - Reset (autoCommit) on connection com.mysql.jdbc.JDBC4Connection@1c9b0314

What does that mean? Is this something I should worry about/fix, or is it normal? I'm trying to understand what really happens there.


Solution

  • It means either:

    • the pool is configured as auto-commit, but code is changing connections to autoCommit=false, and then returning them to the pool, or
    • the pool is configured as not auto-commit, but code is changing the connections to autoCommit=true, and then returning them to the pool.

    HikariCP will reset autoCommit to the pool default whenever a connection is returned with a different autoCommit mode. In general this can have a negative impact on performance; sometimes quite large.