How can I release the JDBC connection that is hooked by ERXJDBCConnectionAnalyser class?
public WOActionResults monitorAction() {
NSMutableDictionary<String, String> dictStatus = new NSMutableDictionary<String, String>();
for (EOModel m : EOModelGroup.defaultGroup().models()) {
ERXJDBCConnectionAnalyzer ca = new ERXJDBCConnectionAnalyzer(m);
try {
ca.testConnection();
dictStatus.put(
m.name(),
"OK");
} catch (Throwable t) {
dictStatus.put(
m.name(),
"Error: " + t.getMessage());
}
}
WOComponent page = pageWithName(Monitor.class.getName());
page.takeValueForKey(dictStatus, "dictStatus");
return page;
}
If I set the useConnectionBroker property to "false", it works okay. Otherwise I get following exception.
er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:84) - Checking JDBC connection with information {minConnections = "1"; ... ... ... ... ... ...
2010-10-28 15:33:39,297 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:105) - Trying to create JDBCAdaptor...
2010-10-28 15:33:39,297 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:115) - Successfully created adaptor er.extensions.jdbc.ERXJDBCAdaptor
2010-10-28 15:33:39,298 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:126) - Trying to create plugin...
2010-10-28 15:33:39,298 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:131) - Created plugin com.webobjects.jdbcadaptor.PostgresqlPlugIn
2010-10-28 15:33:39,298 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:170) - Trying to load JDBC driver org.postgresql.Driver...
2010-10-28 15:33:39,299 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:183) - Successfully loaded JDBC driver org.postgresql.Driver
2010-10-28 15:33:39,299 INFO XXXXXXXX[-:12345 0] er.transaction.adaptor.ConnectionAnalyzer (ERXJDBCConnectionAnalyzer.java:192) - JDBC driver and plugin are loaded, trying to connect...
2010-10-28 15:33:41,299 WARN XXXXXXXX[-:12345 0] er.extensions.jdbc.ERXJDBCConnectionBroker (ERXJDBCConnectionBroker.java:368) - Connections Exhausted! Will wait and try again in loop 0
2010-10-28 15:33:43,300 WARN XXXXXXXX[-:12345 0] er.extensions.jdbc.ERXJDBCConnectionBroker (ERXJDBCConnectionBroker.java:368) - Connections Exhausted! Will wait and try again in loop 1
2010-10-28 15:33:45,301 WARN XXXXXXXX[-:12345 0] er.extensions.jdbc.ERXJDBCConnectionBroker (ERXJDBCConnectionBroker.java:368) - Connections Exhausted! Will wait and try again in loop 2