Closing Pool and number of active connections

850 views
Skip to first unread message

afterb...@gmail.com

unread,
Jan 26, 2017, 12:31:08 PM1/26/17
to HikariCP
Hello, i am new to HikariCP..

i have a few of questions.. i'm developing a JSF webapp..

1) how can i count the number of active/idle connections in a db pool? (i have two data sources active.. one for mysql and one for sql server)
2) how can i close the db poll and free resources (avoiding memory leaks)?

thanks!

Brett Wooldridge

unread,
Jan 26, 2017, 1:23:25 PM1/26/17
to HikariCP
Monitoring is best done through the JMX bean, either programmatically or through jconsole:


To close the pool just call HikariDataSource.close().  :-)

-Brett

afterb...@gmail.com

unread,
Jan 26, 2017, 4:21:03 PM1/26/17
to HikariCP

Thank you Brett!

afterb...@gmail.com

unread,
Feb 1, 2017, 7:03:15 AM2/1/17
to HikariCP
Hello Brett,
i have seen the page : https://github.com/brettwooldridge/HikariCP/wiki/MBean-(JMX)-Monitoring-and-Management
the code works with "poolName"... but how can I do it without specifying the poolName? or to see all the active pools?
thanks!





Il giorno giovedì 26 gennaio 2017 19:23:25 UTC+1, Brett Wooldridge ha scritto:

Brett Wooldridge

unread,
Feb 1, 2017, 5:55:17 PM2/1/17
to HikariCP
No idea. JMX has the ability to enumerate registered MBeans ... somehow ... read the JMX javadocs.
Reply all
Reply to author
Forward
0 new messages