I am new in DBCP
.
I am using DBCP connection pool
with Spring
and hibernate
,Database
is MYSQL
.
I am unable to find how many connections
are created in connection pool
.
Every time it's giving different processlist count.
I am using configuration is:
<code>
dbcp.maxActive =11
dbcp.maxIdle =70
dbcp.validationQuery=SELECT 1
dbcp.minIdle =6
dbcp.timeBetweenEvictionRunsMillis=34000
dbcp.minEvictableIdleTimeMillis = 55000
dbcp.testOnBorrow =true
</code>
Please help me out if any one having idea. Thanks
The default
dbcp connection
pool is 8connections
, so if you want to run 9 simultaneous queries one of them will be blocked. From the javadocs, you should be able to read this from the getNumIdle() and getNumActive() methods, if you can get an instance of the BasicDataSource or connect to the database and runexec sp_who2
which will show you what is connected, and active, and whether any queries are being blocked. One suggestion is their if you are aware about itDBCP
,it has more issues and I would suggest you to useHikariCP
, it has got the most of it (ideal for performance related tasks) here the link which will give you a useful for demo and lastly useSpring's SimpleJdbcTemplate
which are more involved in simplicity.