Skip to content
Snippets Groups Projects
Commit 575dc6a2 authored by srosse's avatar srosse
Browse files

OO-623: fix the monitoring of OpenOLAT c3p0 connection pool after upgrade of hibernate and c3p0

parent 1573eb86
No related branches found
No related tags found
No related merge requests found
......@@ -117,11 +117,14 @@ public class DatabaseWebService {
for(ObjectName name:names) {
String cName = name.getCanonicalName();
if(cName.startsWith("com.mchange.v2.c3p0:type=PooledDataSource")) {
System.out.println("cName: " + cName);
if(cName.startsWith("com.mchange.v2.c3p0:") && cName.indexOf("type=PooledDataSource") > 0) {
MBeanInfo info = mBeanServer.getMBeanInfo(name);
MBeanAttributeInfo[] attrs = info.getAttributes();
for(MBeanAttributeInfo attr:attrs) {
String attrName = attr.getName();
System.out.println(attrName);
if("numBusyConnectionsAllUsers".equals(attrName)) {
Number obj = (Number)mBeanServer.getAttribute(name, "numBusyConnectionsAllUsers");
activeConnectionCount += obj.intValue();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment