问题
How to find the active number of open database connections in H2/MySQL. We need this information to identify if there are any connection leaks.
回答1:
For H2, use:
select * from information_schema.sessions;
For MySQL, use:
show full processlist;
or
select * from information_schema.processlist;
If you are just interested in the session count, use select count(*) instead of select *
来源:https://stackoverflow.com/questions/6137683/how-to-find-the-active-number-of-open-database-connections-in-h2-mysql