At some place, we have used JDBC and in some cases we used hibernate to access database. Now, after some business operations, we are running out of connections. So, I want to know after each business operation how many connections are opened to database collectively by direct JDBC call and hibernate. While getting connection from JDBC, we have used the same data source, we declared in hibernate configuration. So, I want to know whether hibernate provide such functionality. I tried the following code snippet but gives 0 all the time.
dBSession.getSessionFactory().getStatistics().getConnectCount()
Thanks,
Kalpesh
|