Reset (autoCommit) on connection in HikariCP

混江龙づ霸主 提交于 2019-11-28 00:57:16

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/41202242/reset-autocommit-on-connection-in-hikaricp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!