i have a Java Servlet and i want to use connection pooling together with jdbc (Database: mysql).
So here is what i\'m doing:
(This class is public final class DB
Couple of things. First, What version of HikariCP, Java, and the MySQL driver?
Second, 400 connections in one pool? Way too many! Start with 10 to 20, in each pool. You'll be surprised that you can handle a few thousand transactions per second.
Third, this is the second question in the FAQ. Read the answer and the link. You need to set maxLifetime
to something shorter (by 1 minute) than your MySQL native timeout.
Lastly, turn on DEBUG logging, HikariCP is not noisy. Every 30 seconds, the housekeeping thread runs and logs pool statistics.