https://openhome.cc/Gossip/CodeData/JDK8/Map.html
computeIfAbsent和computeIfPresent使用範例
https://stackoverflow.com/questions/59493461/can-i-use-concurrenthashmap-with-integer-for-thread-safe-counters
Java 6
https://github.com/imrexhuang/HikariCPClientExample/tree/master/ForJava6
Java 8+
https://github.com/imrexhuang/HikariCPClientExample/tree/master/ForJava8%2B
HikariCP
https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
HikariCP Maven:
https://search.maven.org/search?q=com.zaxxer.hikaricp
作者:Brett Wooldridge
https://github.com/brettwooldridge
作者為何要開發HikariCP的專訪
https://dzone.com/articles/jooq-tuesdays-what-it-takes-to-write-the-fastest-java-connection-pool
利用SQL Server的sp_who指令查看
沒有設定setMinimumIdle和setMaximumPoolSize時,的確預設是建立10個Connection
超過預設10個Connection會出現以下錯誤訊息,無法再用HikariDataSource去getConnection導致timeout:
java.sql.SQLTimeoutException: Timeout after 30004ms of waiting for a connection.
at com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:233)
at com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:183)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:93)
at HikariCPDataSource.getConnection(HikariCPDataSource.java:33)
at SQLServerPOC.main(SQLServerPOC.java:25)