[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ConnectionPool.java,1.70,1.71
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2003-10-30 00:11:18
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv533/src/java/org/logicalcobwebs/proxool Modified Files: ConnectionPool.java Log Message: Debug info and error logged if unsuccessful attempt to put connection back in pool. Plus connectioninfo comparator changed Index: ConnectionPool.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPool.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** ConnectionPool.java 30 Sep 2003 18:39:08 -0000 1.70 --- ConnectionPool.java 30 Oct 2003 00:11:15 -0000 1.71 *************** *** 329,333 **** long start = proxyConnection.getTimeLastStartActive(); if (now - start < 0) { ! log.warn("Future start time detected. #" + proxyConnection.getId() + " start = " + new Date(start)); } else if (now - start > 1000000) { log.warn("Suspiciously long active time. #" + proxyConnection.getId() + " start = " + new Date(start)); --- 329,334 ---- long start = proxyConnection.getTimeLastStartActive(); if (now - start < 0) { ! log.warn("Future start time detected. #" + proxyConnection.getId() + " start = " + new Date(start) ! + " (" + (now - start) + " milliseconds)"); } else if (now - start > 1000000) { log.warn("Suspiciously long active time. #" + proxyConnection.getId() + " start = " + new Date(start)); *************** *** 342,357 **** } } else { - // Let's make it available for someone else - proxyConnection.setStatus(ProxyConnectionIF.STATUS_ACTIVE, ProxyConnectionIF.STATUS_AVAILABLE); - } ! // Optionally, test it to see if it is ok ! if (getDefinition().isTestAfterUse()) { ! // It will get removed by this call if it is no good ! testConnection(proxyConnection); } if (log.isDebugEnabled() && getDefinition().isVerbose()) { ! log.debug(displayStatistics() + " - Connection #" + proxyConnection.getId() + " returned"); } --- 343,365 ---- } } else { ! // Optionally, test it to see if it is ok ! if (getDefinition().isTestAfterUse()) { ! // It will get removed by this call if it is no good ! testConnection(proxyConnection); ! } ! ! // Let's make it available for someone else ! if (!proxyConnection.setStatus(ProxyConnectionIF.STATUS_ACTIVE, ProxyConnectionIF.STATUS_AVAILABLE)) { ! log.error("Unable to set status of connection " + proxyConnection.getId() ! + "from " + getStatusDescription(ProxyConnectionIF.STATUS_ACTIVE) ! + "to " + getStatusDescription(ProxyConnectionIF.STATUS_ACTIVE) ! + ". It remains " + getStatusDescription(proxyConnection.getStatus())); ! } } if (log.isDebugEnabled() && getDefinition().isVerbose()) { ! log.debug(displayStatistics() + " - Connection #" + proxyConnection.getId() + " returned (now " ! + getStatusDescription(proxyConnection.getStatus()) + ")"); } *************** *** 811,827 **** protected Collection getConnectionInfos() { Collection cis = null; ! cis = new TreeSet(new Comparator() { ! public int compare(Object o1, Object o2) { ! try { ! Date birth1 = ((ConnectionInfoIF) o1).getBirthDate(); ! Date birth2 = ((ConnectionInfoIF) o2).getBirthDate(); ! return birth1.compareTo(birth2); ! } catch (ClassCastException e) { ! log.error("Unexpected contents of connectionInfos Set: " + o1.getClass() + " and " + o2.getClass(), e); ! return String.valueOf(o1.hashCode()).compareTo(String.valueOf(o2.hashCode())); ! } ! } ! }); ! Iterator i = proxyConnections.iterator(); while (i.hasNext()) { --- 819,823 ---- protected Collection getConnectionInfos() { Collection cis = null; ! cis = new TreeSet(); Iterator i = proxyConnections.iterator(); while (i.hasNext()) { *************** *** 1095,1098 **** --- 1091,1097 ---- Revision history: $Log$ + Revision 1.71 2003/10/30 00:11:15 billhorsman + Debug info and error logged if unsuccessful attempt to put connection back in pool. Plus connectioninfo comparator changed + Revision 1.70 2003/09/30 18:39:08 billhorsman New test-before-use, test-after-use and fatal-sql-exception-wrapper-class properties. |