proxool-cvs Mailing List for Proxool: Proxy JDBC Connection Pool (Page 8)
UNMAINTAINED!
Brought to you by:
billhorsman
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(17) |
Mar
(20) |
Apr
(22) |
May
(4) |
Jun
(3) |
Jul
(11) |
Aug
(23) |
Sep
(60) |
Oct
(41) |
Nov
(15) |
Dec
(29) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(5) |
Jun
(29) |
Jul
(6) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(19) |
Nov
|
Dec
|
2006 |
Jan
(17) |
Feb
|
Mar
(5) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2007 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <bil...@us...> - 2003-11-04 13:52:04
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1417/src/java/org/logicalcobwebs/proxool Modified Files: ConnectionPool.java Log Message: Fixed warning message Index: ConnectionPool.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPool.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ConnectionPool.java 30 Oct 2003 00:11:15 -0000 1.71 --- ConnectionPool.java 4 Nov 2003 13:52:01 -0000 1.72 *************** *** 17,21 **** import java.sql.Statement; import java.util.Collection; - import java.util.Comparator; import java.util.Date; import java.util.HashSet; --- 17,20 ---- *************** *** 352,358 **** // 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())); } --- 351,357 ---- // Let's make it available for someone else if (!proxyConnection.setStatus(ProxyConnectionIF.STATUS_ACTIVE, ProxyConnectionIF.STATUS_AVAILABLE)) { ! log.warn("Unable to set status of connection " + proxyConnection.getId() ! + " from " + getStatusDescription(ProxyConnectionIF.STATUS_ACTIVE) ! + "to " + getStatusDescription(ProxyConnectionIF.STATUS_AVAILABLE) + ". It remains " + getStatusDescription(proxyConnection.getStatus())); } *************** *** 1091,1094 **** --- 1090,1096 ---- Revision history: $Log$ + Revision 1.72 2003/11/04 13:52:01 billhorsman + Fixed warning message + 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 |
From: <bil...@us...> - 2003-11-04 13:23:21
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv29315/src/java-test/org/logicalcobwebs/proxool Modified Files: AllTests.java Log Message: Added PropetyTest Index: AllTests.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/AllTests.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AllTests.java 26 Oct 2003 16:23:20 -0000 1.23 --- AllTests.java 4 Nov 2003 13:23:18 -0000 1.24 *************** *** 38,41 **** --- 38,42 ---- suite.addTestSuite(HypersonicTest.class); suite.addTestSuite(ManyPoolsTest.class); + suite.addTestSuite(PropertyTest.class); suite.addTestSuite(PrototyperTest.class); suite.addTestSuite(ProxyConnectionTest.class); *************** *** 63,66 **** --- 64,70 ---- Revision history: $Log$ + Revision 1.24 2003/11/04 13:23:18 billhorsman + Added PropetyTest + Revision 1.23 2003/10/26 16:23:20 billhorsman Fixed up test suites |
From: <bil...@us...> - 2003-11-04 13:22:46
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv29218/src/java-test/org/logicalcobwebs/proxool Added Files: PropertyTest.java Log Message: New test for delegate properties --- NEW FILE: PropertyTest.java --- /* * This software is released under a licence similar to the Apache Software Licence. * See org.logicalcobwebs.proxool.package.html for details. * The latest version is available at http://proxool.sourceforge.net */ package org.logicalcobwebs.proxool; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; /** * Tests whether {@link ConnectionPoolDefinition} recognises properties * properly * @version $Revision: 1.1 $, $Date: 2003/11/04 13:22:43 $ * @author billhorsman * @author $Author: billhorsman $ (current maintainer) * @since Proxool 0.8.2 */ public class PropertyTest extends AbstractProxoolTest { public PropertyTest(String alias) { super(alias); } /** * Test whether we are successfully passing properties onto the delegate driver. This * relies on a feature of Hypersonic 1.7.1 where ResultSetMetaData.isWritable() is * unsupported. The default behaviour, however, is just to return a value that maybe * incorrect but without throwing an exception. If you set the property jdbc.strict_md = true * then Hypersonic does throw an exception. This might change in future versions of Hypersonic * so we should keep an eye on this. * See <a href="http://hsqldb.sourceforge.net/doc/src/org/hsqldb/jdbcResultSet.html">http://hsqldb.sourceforge.net/doc/src/org/hsqldb/jdbcResultSet.html</a> */ public void testDelegateProperty() throws Exception { String testName = "delegateProperty"; String alias = testName; // Register pool String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); Connection c = null; try { c = DriverManager.getConnection(url, info); Statement s = c.createStatement(); try { s.execute("drop table z"); } catch (SQLException e) { // Probably because it doesn't exist. } s.execute("create table z (a int(4))"); s.execute("select * from z"); ResultSet rs = s.getResultSet(); ResultSetMetaData rsmd = rs.getMetaData(); // by default, this should work without error (even if the value returned is rubbish) rsmd.isWritable(1); } finally { if (c != null) { c.close(); c = null; } } // And now test with the strict meta data info.setProperty("jdbc.strict_md", "true"); try { c = DriverManager.getConnection(url, info); Statement s = c.createStatement(); s.execute("select * from z"); ResultSet rs = s.getResultSet(); ResultSetMetaData rsmd = rs.getMetaData(); try { rsmd.isWritable(1); fail("Expected isWritable() to throw unsupported exception"); } catch (SQLException e) { // Expected an exception } } finally { if (c != null) { c.close(); } } } } /* Revision history: $Log: PropertyTest.java,v $ Revision 1.1 2003/11/04 13:22:43 billhorsman New test for delegate properties */ |
From: <bil...@us...> - 2003-10-30 00:16:16
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1407/src/java/org/logicalcobwebs/proxool Modified Files: ProxoolFacade.java Log Message: Throw a friendlier exception if you try and add a statistics listener to a pool with no statistics Index: ProxoolFacade.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxoolFacade.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** ProxoolFacade.java 16 Oct 2003 18:52:35 -0000 1.73 --- ProxoolFacade.java 30 Oct 2003 00:16:13 -0000 1.74 *************** *** 614,619 **** */ public static void addStatisticsListener(String alias, StatisticsListenerIF statisticsListener) throws ProxoolException { final Admin monitor = ConnectionPoolManager.getInstance().getConnectionPool(alias).getAdmin(); ! monitor.addStatisticsListener(statisticsListener); } --- 614,624 ---- */ public static void addStatisticsListener(String alias, StatisticsListenerIF statisticsListener) throws ProxoolException { + // TODO investigate what happens if we add a statistics monitor after we register a listener final Admin monitor = ConnectionPoolManager.getInstance().getConnectionPool(alias).getAdmin(); ! if (monitor != null) { ! monitor.addStatisticsListener(statisticsListener); ! } else { ! throw new ProxoolException("Statistics are switched off, your can't add a listener"); ! } } *************** *** 704,707 **** --- 709,715 ---- Revision history: $Log$ + Revision 1.74 2003/10/30 00:16:13 billhorsman + Throw a friendlier exception if you try and add a statistics listener to a pool with no statistics + Revision 1.73 2003/10/16 18:52:35 billhorsman Fixed a bug: the redefine() method was actually calling the update() method. Also, added checks to make the |
From: <bil...@us...> - 2003-10-30 00:14:02
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1029/src/java/org/logicalcobwebs/proxool Modified Files: ConnectionPoolDefinition.java Log Message: Fixed bug where all proxool properties were getting passed onto the delegate driver, and all delegate properties weren't Index: ConnectionPoolDefinition.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinition.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ConnectionPoolDefinition.java 24 Oct 2003 15:22:21 -0000 1.28 --- ConnectionPoolDefinition.java 30 Oct 2003 00:13:59 -0000 1.29 *************** *** 382,386 **** } ! if (key.startsWith(ProxoolConstants.PROPERTY_PREFIX)) { if (isChanged(getDelegateProperty(key), value)) { changed = true; --- 382,386 ---- } ! if (!key.startsWith(ProxoolConstants.PROPERTY_PREFIX)) { if (isChanged(getDelegateProperty(key), value)) { changed = true; *************** *** 1132,1135 **** --- 1132,1138 ---- Revision history: $Log$ + Revision 1.29 2003/10/30 00:13:59 billhorsman + Fixed bug where all proxool properties were getting passed onto the delegate driver, and all delegate properties weren't + Revision 1.28 2003/10/24 15:22:21 billhorsman Fixed bug where connection pool was being recognised as changed even when it wasn't. (This bug introduced after 0.7.2). |
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. |
From: <bil...@us...> - 2003-10-30 00:05:56
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv32204/src/java/org/logicalcobwebs/proxool Modified Files: AbstractProxyConnection.java ConnectionInfo.java ConnectionInfoIF.java Log Message: now implements Comparable (using ID) Index: AbstractProxyConnection.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/AbstractProxyConnection.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AbstractProxyConnection.java 27 Aug 2003 18:19:07 -0000 1.22 --- AbstractProxyConnection.java 30 Oct 2003 00:05:49 -0000 1.23 *************** *** 442,445 **** --- 442,455 ---- } } + + /** + * Compares using {@link #getId()} + * @param o must be another {@link ConnectionInfoIF} implementation + * @return the comparison + * @see Comparable#compareTo(Object) + */ + public int compareTo(Object o) { + return new Long(((ConnectionInfoIF) o).getId()).compareTo(new Long(getId())); + } } *************** *** 448,451 **** --- 458,464 ---- Revision history: $Log$ + Revision 1.23 2003/10/30 00:05:49 billhorsman + now implements Comparable (using ID) + Revision 1.22 2003/08/27 18:19:07 billhorsman whoops Index: ConnectionInfo.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionInfo.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConnectionInfo.java 3 Mar 2003 11:11:56 -0000 1.5 --- ConnectionInfo.java 30 Oct 2003 00:05:50 -0000 1.6 *************** *** 143,146 **** --- 143,156 ---- this.delegateHashcode = delegateHashcode; } + + /** + * Compares using {@link #getId()} + * @param o must be another {@link ConnectionInfoIF} implementation + * @return the comparison + * @see Comparable#compareTo(Object) + */ + public int compareTo(Object o) { + return new Long(((ConnectionInfoIF) o).getId()).compareTo(new Long(getId())); + } } *************** *** 149,152 **** --- 159,165 ---- Revision history: $Log$ + Revision 1.6 2003/10/30 00:05:50 billhorsman + now implements Comparable (using ID) + Revision 1.5 2003/03/03 11:11:56 billhorsman fixed licence Index: ConnectionInfoIF.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionInfoIF.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ConnectionInfoIF.java 3 Mar 2003 11:11:57 -0000 1.9 --- ConnectionInfoIF.java 30 Oct 2003 00:05:50 -0000 1.10 *************** *** 27,31 **** * @author $Author$ (current maintainer) */ ! public interface ConnectionInfoIF { /** --- 27,31 ---- * @author $Author$ (current maintainer) */ ! public interface ConnectionInfoIF extends Comparable { /** *************** *** 152,155 **** --- 152,158 ---- Revision history: $Log$ + Revision 1.10 2003/10/30 00:05:50 billhorsman + now implements Comparable (using ID) + Revision 1.9 2003/03/03 11:11:57 billhorsman fixed licence |
From: <bil...@us...> - 2003-10-27 20:29:10
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin In directory sc8-pr-cvs1:/tmp/cvs-serv10445/src/java/org/logicalcobwebs/proxool/admin Modified Files: Admin.java Log Message: connectionReturned() and connectionRefused() calls will now log any errors and continue rather than possibly throwing RuntimeExceptions back to the caller. In principle, stats should not cause problems to the core code. (No evidence of this happening - but it's more robust now.) Index: Admin.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin/Admin.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Admin.java 30 Aug 2003 14:54:04 -0000 1.6 --- Admin.java 27 Oct 2003 20:26:19 -0000 1.7 *************** *** 68,75 **** */ public void connectionReturned(long activeTime) { ! Iterator i = statsRollers.values().iterator(); ! while (i.hasNext()) { ! StatsRoller statsRoller = (StatsRoller) i.next(); ! statsRoller.connectionReturned(activeTime); } } --- 68,79 ---- */ public void connectionReturned(long activeTime) { ! try { ! Iterator i = statsRollers.values().iterator(); ! while (i.hasNext()) { ! StatsRoller statsRoller = (StatsRoller) i.next(); ! statsRoller.connectionReturned(activeTime); ! } ! } catch (Throwable e) { ! LOG.error("Stats connectionReturned call failed. Ignoring.", e); } } *************** *** 79,86 **** */ public void connectionRefused() { ! Iterator i = statsRollers.values().iterator(); ! while (i.hasNext()) { ! StatsRoller statsRoller = (StatsRoller) i.next(); ! statsRoller.connectionRefused(); } } --- 83,94 ---- */ public void connectionRefused() { ! try { ! Iterator i = statsRollers.values().iterator(); ! while (i.hasNext()) { ! StatsRoller statsRoller = (StatsRoller) i.next(); ! statsRoller.connectionRefused(); ! } ! } catch (Exception e) { ! LOG.error("Stats connectionRefused call failed. Ignoring.", e); } } *************** *** 161,164 **** --- 169,177 ---- Revision history: $Log$ + Revision 1.7 2003/10/27 20:26:19 billhorsman + connectionReturned() and connectionRefused() calls will now log any errors and continue rather than + possibly throwing RuntimeExceptions back to the caller. In principle, stats should not cause problems + to the core code. (No evidence of this happening - but it's more robust now.) + Revision 1.6 2003/08/30 14:54:04 billhorsman Checkstyle |
From: <bil...@us...> - 2003-10-27 20:27:16
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin In directory sc8-pr-cvs1:/tmp/cvs-serv10159/src/java/org/logicalcobwebs/proxool/admin Modified Files: StatsRoller.java Log Message: roll() now makes an additional call to isCurrent() *before* it asks for a write lock. Before it was getting a write lock every five seconds which effectively blocks all connections (if only briefly). Index: StatsRoller.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin/StatsRoller.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StatsRoller.java 10 Sep 2003 22:21:04 -0000 1.7 --- StatsRoller.java 27 Oct 2003 20:24:48 -0000 1.8 *************** *** 114,130 **** private void roll() { ! try { ! readWriteLock.writeLock().acquire(); ! if (!isCurrent()) { ! currentStatistics.setStopDate(nextRollDate.getTime()); ! completeStatistics = currentStatistics; ! currentStatistics = new Statistics(nextRollDate.getTime()); ! nextRollDate.add(units, period); ! compositeStatisticsListener.statistics(alias, completeStatistics); } - } catch (InterruptedException e) { - LOG.error("Unable to roll statistics log", e); - } finally { - readWriteLock.writeLock().release(); } } --- 114,132 ---- private void roll() { ! if (!isCurrent()) { ! try { ! readWriteLock.writeLock().acquire(); ! if (!isCurrent()) { ! currentStatistics.setStopDate(nextRollDate.getTime()); ! completeStatistics = currentStatistics; ! currentStatistics = new Statistics(nextRollDate.getTime()); ! nextRollDate.add(units, period); ! compositeStatisticsListener.statistics(alias, completeStatistics); ! } ! } catch (Throwable e) { ! LOG.error("Unable to roll statistics log", e); ! } finally { ! readWriteLock.writeLock().release(); } } } *************** *** 138,144 **** */ public void connectionReturned(long activeTime) { ! if (!isCurrent()) { ! roll(); ! } try { readWriteLock.readLock().acquire(); --- 140,144 ---- */ public void connectionReturned(long activeTime) { ! roll(); try { readWriteLock.readLock().acquire(); *************** *** 155,161 **** */ public void connectionRefused() { ! if (!isCurrent()) { ! roll(); ! } try { readWriteLock.readLock().acquire(); --- 155,159 ---- */ public void connectionRefused() { ! roll(); try { readWriteLock.readLock().acquire(); *************** *** 189,192 **** --- 187,194 ---- Revision history: $Log$ + Revision 1.8 2003/10/27 20:24:48 billhorsman + roll() now makes an additional call to isCurrent() *before* it asks for a write lock. Before it + was getting a write lock every five seconds which effectively blocks all connections (if only briefly). + Revision 1.7 2003/09/10 22:21:04 chr32 Removing > jdk 1.2 dependencies. |
From: <bil...@us...> - 2003-10-27 13:18:33
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv20786 Modified Files: CHANGES.txt build.xml Log Message: new version Index: CHANGES.txt =================================================================== RCS file: /cvsroot/proxool/proxool/CHANGES.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** CHANGES.txt 26 Oct 2003 15:23:53 -0000 1.28 --- CHANGES.txt 27 Oct 2003 13:13:58 -0000 1.29 *************** *** 6,10 **** $Author$ ! 0.8.0 - (26 October, 2003) - We now use Cglib's proxy library. Together with dropping the use of Timer --- 6,20 ---- $Author$ ! 0.8.1 - October 27, 2003 ! ! - NullPointerException that occured during SQL logging for certain methods ! of excecuting statements has been fixed. Also, logging is optimised to ! do less work if nothing is listening. (No ConnectionListeners registered ! and log level not equal to debug or trace is off). ! ! - Fixed typos in ShutdownHook. And now silently ignore IllegalStateException ! during removal of shutdownHook that occurs during JVM shut down. ! ! 0.8.0 - October 26, 2003 - We now use Cglib's proxy library. Together with dropping the use of Timer Index: build.xml =================================================================== RCS file: /cvsroot/proxool/proxool/build.xml,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** build.xml 26 Oct 2003 15:33:27 -0000 1.65 --- build.xml 27 Oct 2003 13:13:58 -0000 1.66 *************** *** 27,31 **** <!-- Currect release, e.g. 0.6 --> ! <property name="release" value="0.8.0"/> <!-- Currect release, e.g. 0.6 --> --- 27,31 ---- <!-- Currect release, e.g. 0.6 --> ! <property name="release" value="0.8.1"/> <!-- Currect release, e.g. 0.6 --> |
From: <bil...@us...> - 2003-10-27 13:18:33
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv20786/src/java/org/logicalcobwebs/proxool Modified Files: Version.java Log Message: new version Index: Version.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/Version.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Version.java 26 Oct 2003 15:23:30 -0000 1.15 --- Version.java 27 Oct 2003 13:13:58 -0000 1.16 *************** *** 40,44 **** private static final String BUILD_DATE = null; ! private static final String CVS = "0.8.0+"; public static String getVersion() { --- 40,44 ---- private static final String BUILD_DATE = null; ! private static final String CVS = "0.8.1+"; public static String getVersion() { *************** *** 77,80 **** --- 77,83 ---- Revision history: $Log$ + Revision 1.16 2003/10/27 13:13:58 billhorsman + new version + Revision 1.15 2003/10/26 15:23:30 billhorsman 0.8.0 |
From: <bil...@us...> - 2003-10-27 12:38:54
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14448/src/java/org/logicalcobwebs/proxool Modified Files: ShutdownHook.java Log Message: Fixed typos and silently ignore IllegalStateException during shutdownHook removal (it's probably because the JVM is shutting down). Index: ShutdownHook.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ShutdownHook.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ShutdownHook.java 7 Sep 2003 22:05:15 -0000 1.8 --- ShutdownHook.java 27 Oct 2003 12:32:06 -0000 1.9 *************** *** 45,53 **** LOG.warn("Proxool will have to be shutdown manually with ProxoolFacade.shutdown() because this version of the JDK does not support Runtime.getRuntime().addShutdownHook()"); } catch (SecurityException e) { ! LOG.error("Probelm registering sutdownHook", e); } catch (IllegalAccessException e) { ! LOG.error("Probelm registering sutdownHook", e); } catch (InvocationTargetException e) { ! LOG.error("Probelm registering sutdownHook", e); } } --- 45,58 ---- LOG.warn("Proxool will have to be shutdown manually with ProxoolFacade.shutdown() because this version of the JDK does not support Runtime.getRuntime().addShutdownHook()"); } catch (SecurityException e) { ! LOG.error("Problem removing shutdownHook", e); } catch (IllegalAccessException e) { ! LOG.error("Problem removing shutdownHook", e); } catch (InvocationTargetException e) { ! if (e.getCause() instanceof IllegalStateException) { ! // This is probably because a shutdown is in progress. We can ! // safely ignore that. ! } else { ! LOG.error("Problem removing shutdownHook", e); ! } } } *************** *** 70,78 **** LOG.warn("Proxool will have to be shutdown manually with ProxoolFacade.shutdown() because this version of the JDK does not support Runtime.getRuntime().addShutdownHook()"); } catch (SecurityException e) { ! LOG.error("Probelm registering sutdownHook", e); } catch (IllegalAccessException e) { ! LOG.error("Probelm registering sutdownHook", e); } catch (InvocationTargetException e) { ! LOG.error("Probelm registering sutdownHook", e); } } --- 75,83 ---- LOG.warn("Proxool will have to be shutdown manually with ProxoolFacade.shutdown() because this version of the JDK does not support Runtime.getRuntime().addShutdownHook()"); } catch (SecurityException e) { ! LOG.error("Problem registering shutdownHook", e); } catch (IllegalAccessException e) { ! LOG.error("Problem registering shutdownHook", e); } catch (InvocationTargetException e) { ! LOG.error("Problem registering shutdownHook", e); } } *************** *** 94,97 **** --- 99,106 ---- Revision history: $Log$ + Revision 1.9 2003/10/27 12:32:06 billhorsman + Fixed typos and silently ignore IllegalStateException during shutdownHook removal (it's probably because + the JVM is shutting down). + Revision 1.8 2003/09/07 22:05:15 billhorsman Now uses reflection to add ShutdownHook to Runtime so that it is JDK independent. Using JDK1.2 |
From: <bil...@us...> - 2003-10-27 12:27:34
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv12856/src/java/org/logicalcobwebs/proxool Modified Files: AbstractProxyStatement.java Log Message: Optimisation to avoid preparing sql log if tracing is off. Index: AbstractProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/AbstractProxyStatement.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AbstractProxyStatement.java 27 Oct 2003 11:18:42 -0000 1.15 --- AbstractProxyStatement.java 27 Oct 2003 12:21:59 -0000 1.16 *************** *** 170,181 **** protected void trace(long startTime, Exception exception) throws SQLException { ! // Log if configured to ! if (connectionPool.getLog().isDebugEnabled() && connectionPool.getDefinition().isTrace()) { ! connectionPool.getLog().debug(sqlLog.toString() + " (" + (System.currentTimeMillis() - startTime) + " milliseconds" + (exception != null ? ", threw a " + exception.getClass().getName() + ": " + exception.getMessage() + ")" : ")")); } - // Send to any listener - connectionPool.onExecute(sqlLog.toString(), (System.currentTimeMillis() - startTime), exception); - // Clear parameters for next time if (parameters != null) { --- 170,182 ---- protected void trace(long startTime, Exception exception) throws SQLException { ! if (isTrace()) { ! // Log if configured to ! if (connectionPool.getLog().isDebugEnabled() && connectionPool.getDefinition().isTrace()) { ! connectionPool.getLog().debug(sqlLog.toString() + " (" + (System.currentTimeMillis() - startTime) + " milliseconds" + (exception != null ? ", threw a " + exception.getClass().getName() + ": " + exception.getMessage() + ")" : ")")); ! } ! // Send to any listener ! connectionPool.onExecute(sqlLog.toString(), (System.currentTimeMillis() - startTime), exception); } // Clear parameters for next time if (parameters != null) { *************** *** 193,197 **** */ protected void appendToSqlLog() { ! if (sqlStatement != null && sqlStatement.length() > 0) { int parameterIndex = 0; StringTokenizer st = new StringTokenizer(sqlStatement, "?"); --- 194,198 ---- */ protected void appendToSqlLog() { ! if (sqlStatement != null && sqlStatement.length() > 0 && isTrace()) { int parameterIndex = 0; StringTokenizer st = new StringTokenizer(sqlStatement, "?"); *************** *** 213,219 **** } sqlLog.append("; "); ! if (parameters != null) { ! parameters.clear(); ! } } } --- 214,220 ---- } sqlLog.append("; "); ! } ! if (parameters != null) { ! parameters.clear(); } } *************** *** 239,242 **** --- 240,246 ---- Revision history: $Log$ + Revision 1.16 2003/10/27 12:21:59 billhorsman + Optimisation to avoid preparing sql log if tracing is off. + Revision 1.15 2003/10/27 11:18:42 billhorsman Fix for sqlStatement being null. |
From: <bil...@us...> - 2003-10-27 11:23:55
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv2169/src/java/org/logicalcobwebs/proxool Modified Files: AbstractProxyStatement.java Log Message: Fix for sqlStatement being null. Index: AbstractProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/AbstractProxyStatement.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AbstractProxyStatement.java 19 Oct 2003 09:50:08 -0000 1.14 --- AbstractProxyStatement.java 27 Oct 2003 11:18:42 -0000 1.15 *************** *** 193,217 **** */ protected void appendToSqlLog() { ! int parameterIndex = 0; ! StringTokenizer st = new StringTokenizer(sqlStatement, "?"); ! while (st.hasMoreTokens()) { ! if (parameterIndex > 0) { ! if (parameters != null) { ! final Object value = parameters.get(new Integer(parameterIndex)); ! if (value != null) { ! sqlLog.append(value); } else { ! sqlLog.append("?"); } - } else { - sqlLog.append("?"); } } - parameterIndex++; - sqlLog.append(st.nextToken()); - } - sqlLog.append("; "); - if (parameters != null) { - parameters.clear(); } } --- 193,219 ---- */ protected void appendToSqlLog() { ! if (sqlStatement != null && sqlStatement.length() > 0) { ! int parameterIndex = 0; ! StringTokenizer st = new StringTokenizer(sqlStatement, "?"); ! while (st.hasMoreTokens()) { ! if (parameterIndex > 0) { ! if (parameters != null) { ! final Object value = parameters.get(new Integer(parameterIndex)); ! if (value != null) { ! sqlLog.append(value); ! } else { ! sqlLog.append("?"); ! } } else { ! sqlLog.append("?"); } } + parameterIndex++; + sqlLog.append(st.nextToken()); + } + sqlLog.append("; "); + if (parameters != null) { + parameters.clear(); } } } *************** *** 237,240 **** --- 239,245 ---- Revision history: $Log$ + Revision 1.15 2003/10/27 11:18:42 billhorsman + Fix for sqlStatement being null. + Revision 1.14 2003/10/19 09:50:08 billhorsman Debug exception displays class name. |
From: <bil...@us...> - 2003-10-26 16:25:48
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/logging In directory sc8-pr-cvs1:/tmp/cvs-serv24768/src/java-test/org/logicalcobwebs/logging Added Files: AllTests.java Log Message: Fixed up test suites --- NEW FILE: AllTests.java --- /* * This software is released under a licence similar to the Apache Software Licence. * See org.logicalcobwebs.proxool.package.html for details. * The latest version is available at http://proxool.sourceforge.net */ package org.logicalcobwebs.logging; import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestSuite; import org.logicalcobwebs.proxool.GlobalTest; /** * Run all tests * * @version $Revision: 1.1 $, $Date: 2003/10/26 16:23:20 $ * @author Bill Horsman (bi...@lo...) * @author $Author: billhorsman $ (current maintainer) * @since Proxool 0.5 */ public class AllTests { /** * Run all tests * * @return a composite test of all Proxool tests. */ public static Test suite() { TestSuite suite = new TestSuite(); suite.addTestSuite(Jdk14LoggerTest.class); // create a wrapper for global initialization code. TestSetup wrapper = new TestSetup(suite) { public void setUp() throws Exception { GlobalTest.globalSetup(); } }; return wrapper; } } /* Revision history: $Log: AllTests.java,v $ Revision 1.1 2003/10/26 16:23:20 billhorsman Fixed up test suites Revision 1.22 2003/09/28 09:38:39 billhorsman New unit test for Hibernate. Revision 1.21 2003/04/27 22:11:34 billhorsman temporary removal of PerformanceTest Revision 1.20 2003/04/27 15:46:11 billhorsman moved DataSourceTest to sandbox Revision 1.19 2003/04/19 13:01:01 billhorsman improve tests Revision 1.18 2003/03/11 14:58:30 billhorsman put PerformanceTest back in the global test Revision 1.17 2003/03/03 11:12:03 billhorsman fixed licence Revision 1.16 2003/02/27 18:01:46 billhorsman completely rethought the test structure. it's now more obvious. no new tests yet though. Revision 1.15 2003/02/19 23:25:28 billhorsman new StateListenerTest Revision 1.14 2003/02/19 15:14:22 billhorsman fixed copyright (copy and paste error, not copyright change) Revision 1.13 2003/02/19 13:47:32 chr32 Added configuration listener test. Revision 1.12 2003/02/18 16:51:19 chr32 Added tests for ConnectionListeners. Revision 1.11 2003/02/06 17:41:02 billhorsman now uses imported logging Revision 1.10 2003/01/23 11:13:57 billhorsman remove PerformanceTest from suite Revision 1.9 2002/12/16 17:35:42 chr32 Removed redundant imports. Revision 1.8 2002/12/16 17:06:10 billhorsman new test structure Revision 1.7 2002/12/15 19:16:58 chr32 Added JAXPConfigurator test. Revision 1.6 2002/11/07 18:53:41 billhorsman slight improvement to setup Revision 1.5 2002/11/02 11:37:48 billhorsman New tests Revision 1.4 2002/10/28 21:37:54 billhorsman now allows for non-existent log4jPath Revision 1.3 2002/10/27 13:05:02 billhorsman checkstyle Revision 1.2 2002/10/27 12:03:33 billhorsman clear up of tests Revision 1.1 2002/10/25 10:41:07 billhorsman draft changes to test globalSetup */ |
From: <bil...@us...> - 2003-10-26 16:24:10
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv24768/src/java-test/org/logicalcobwebs/proxool Modified Files: AllTests.java GlobalTest.java Log Message: Fixed up test suites Index: AllTests.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/AllTests.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AllTests.java 28 Sep 2003 09:38:39 -0000 1.22 --- AllTests.java 26 Oct 2003 16:23:20 -0000 1.23 *************** *** 32,38 **** suite.addTestSuite(ConnectionResetterTest.class); suite.addTestSuite(DriverTest.class); ! suite.addTestSuite(ConnectionPoolTests.class); suite.addTestSuite(HouseKeeperTest.class); suite.addTestSuite(HypersonicTest.class); suite.addTestSuite(PrototyperTest.class); suite.addTestSuite(ProxyConnectionTest.class); --- 32,41 ---- suite.addTestSuite(ConnectionResetterTest.class); suite.addTestSuite(DriverTest.class); ! suite.addTestSuite(ConnectionPoolTest.class); ! suite.addTestSuite(FatalSqlExceptionTest.class); ! suite.addTestSuite(HibernateTest.class); suite.addTestSuite(HouseKeeperTest.class); suite.addTestSuite(HypersonicTest.class); + suite.addTestSuite(ManyPoolsTest.class); suite.addTestSuite(PrototyperTest.class); suite.addTestSuite(ProxyConnectionTest.class); *************** *** 42,46 **** suite.addTestSuite(StateListenerTest.class); suite.addTestSuite(UpdateDefinitionTest.class); - suite.addTestSuite(HibernateTest.class); // TODO Need more investigation into why this fails sometimes. // suite.addTestSuite(PerformanceTest.class); --- 45,48 ---- *************** *** 61,64 **** --- 63,69 ---- Revision history: $Log$ + Revision 1.23 2003/10/26 16:23:20 billhorsman + Fixed up test suites + Revision 1.22 2003/09/28 09:38:39 billhorsman New unit test for Hibernate. Index: GlobalTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/GlobalTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GlobalTest.java 30 Sep 2003 18:58:29 -0000 1.17 --- GlobalTest.java 26 Oct 2003 16:23:20 -0000 1.18 *************** *** 66,69 **** --- 66,70 ---- suite.addTest(org.logicalcobwebs.proxool.admin.jmx.AllTests.suite()); suite.addTest(org.logicalcobwebs.proxool.util.AllTests.suite()); + suite.addTest(org.logicalcobwebs.logging.AllTests.suite()); // create a wrapper for global initialization code. *************** *** 85,88 **** --- 86,92 ---- Revision history: $Log$ + Revision 1.18 2003/10/26 16:23:20 billhorsman + Fixed up test suites + Revision 1.17 2003/09/30 18:58:29 billhorsman Increase shutdown grace time to 10 seconds to make tests more robust. |
From: <bil...@us...> - 2003-10-26 16:11:41
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/logging In directory sc8-pr-cvs1:/tmp/cvs-serv22373/src/java-test/org/logicalcobwebs/logging Modified Files: Jdk14LoggerTest.java Log Message: fixed logger name Index: Jdk14LoggerTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/logging/Jdk14LoggerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jdk14LoggerTest.java 11 Sep 2003 23:00:53 -0000 1.1 --- Jdk14LoggerTest.java 26 Oct 2003 16:11:35 -0000 1.2 *************** *** 7,11 **** import org.logicalcobwebs.proxool.AbstractProxoolTest; ! import org.logicalcobwebs.proxool.ConnectionPoolTests; /** --- 7,11 ---- import org.logicalcobwebs.proxool.AbstractProxoolTest; ! import org.logicalcobwebs.proxool.ConnectionPoolTest; /** *************** *** 19,23 **** public class Jdk14LoggerTest extends AbstractProxoolTest { ! private static final Log LOG = LogFactory.getLog(ConnectionPoolTests.class); public Jdk14LoggerTest(String alias) { --- 19,23 ---- public class Jdk14LoggerTest extends AbstractProxoolTest { ! private static final Log LOG = LogFactory.getLog(Jdk14LoggerTest.class); public Jdk14LoggerTest(String alias) { |
From: <bil...@us...> - 2003-10-26 16:10:56
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv22242/src/java-test/org/logicalcobwebs/proxool Added Files: ConnectionPoolTest.java Removed Files: ConnectionPoolTests.java Log Message: renamed to be more consistent --- NEW FILE: ConnectionPoolTest.java --- /* * This software is released under a licence similar to the Apache Software Licence. * See org.logicalcobwebs.proxool.package.html for details. * The latest version is available at http://proxool.sourceforge.net */ package org.logicalcobwebs.proxool; import org.logicalcobwebs.logging.Log; import org.logicalcobwebs.logging.LogFactory; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Connection; import java.util.Properties; /** * Test {@link ConnectionPool} * * @version $Revision: 1.1 $, $Date: 2003/10/26 16:10:46 $ * @author billhorsman * @author $Author: billhorsman $ (current maintainer) * @since Proxool 0.8 */ public class ConnectionPoolTest extends AbstractProxoolTest { private static final Log LOG = LogFactory.getLog(ConnectionPoolTest.class); public ConnectionPoolTest(String name) { super(name); } /** * If we ask for more simultaneous connections then we have allowed we should gracefully * refuse them. */ public void testMaximumConnectionCount() throws Exception { String testName = "maximumConnectionCount"; String alias = testName; String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); info.setProperty(ProxoolConstants.MAXIMUM_CONNECTION_COUNT_PROPERTY, "2"); info.setProperty(ProxoolConstants.VERBOSE_PROPERTY, "true"); ProxoolFacade.registerConnectionPool(url, info); DriverManager.getConnection(url); DriverManager.getConnection(url); try { DriverManager.getConnection(url); fail("Didn't expect to get third connection"); } catch (SQLException e) { LOG.debug("Ignoring expected exception", e); } assertEquals("activeConnectionCount", 2, ProxoolFacade.getSnapshot(alias, true).getActiveConnectionCount()); } /** * test what happens if maximum = minimum = 1 */ public void testMaximumEqualsMinimumConnectionCount() throws Exception { String testName = "maximumEqualsMinimumConnectionCount"; String alias = testName; String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); info.setProperty(ProxoolConstants.MAXIMUM_CONNECTION_COUNT_PROPERTY, "1"); info.setProperty(ProxoolConstants.MINIMUM_CONNECTION_COUNT_PROPERTY, "1"); info.setProperty(ProxoolConstants.VERBOSE_PROPERTY, "true"); ProxoolFacade.registerConnectionPool(url, info); // opening and closing a connection should have no effect Connection c1 = DriverManager.getConnection(url); c1.close(); // Leave this one open for a while Connection c2 = DriverManager.getConnection(url); try { Connection c3 = DriverManager.getConnection(url); c3.close(); fail("Didn't expect to get third connection"); } catch (SQLException e) { LOG.debug("Ignoring expected exception", e); } assertEquals("activeConnectionCount", 1, ProxoolFacade.getSnapshot(alias, true).getActiveConnectionCount()); c2.close(); // Just check it all still works DriverManager.getConnection(url).close(); assertEquals("activeConnectionCount", 0, ProxoolFacade.getSnapshot(alias, true).getActiveConnectionCount()); } /** * Checks whether shutdown is patient enough to wait for active connections */ public void testShutdownPatience() throws ProxoolException, SQLException { String testName = "shutdownPatience"; String alias = testName; String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); info.setProperty(ProxoolConstants.VERBOSE_PROPERTY, "true"); ProxoolFacade.registerConnectionPool(url, info); // Open a connection that will close in 5 seconds new Thread(new Closer(DriverManager.getConnection(url), 5000)).start(); long startTime = System.currentTimeMillis(); ProxoolFacade.removeConnectionPool(alias, 100000); long shutdownTime = System.currentTimeMillis() - startTime; assertTrue("shutdown took too long", shutdownTime < 50000); assertTrue("shutdown was too quick", shutdownTime > 2000); } /** * Checks whether shutdown is impatient enough to shutdown even if * some connections are still active */ public void testShutdownImpatience() throws ProxoolException, SQLException { String testName = "shutdownImpatience"; String alias = testName; String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); info.setProperty(ProxoolConstants.VERBOSE_PROPERTY, "true"); ProxoolFacade.registerConnectionPool(url, info); // Open a connection that will close in 100 seconds new Thread(new Closer(DriverManager.getConnection(url), 100000)).start(); long startTime = System.currentTimeMillis(); ProxoolFacade.removeConnectionPool(alias, 3000); long shutdownTime = System.currentTimeMillis() - startTime; assertTrue("shutdown took too long", shutdownTime < 50000); assertTrue("shutdown was too quick", shutdownTime > 1000); } class Closer implements Runnable { private Connection connection; private long duration; public Closer(Connection connection, long duration) { this.connection = connection; this.duration = duration; } public void run() { long startTime = System.currentTimeMillis(); try { Thread.sleep(duration); } catch (InterruptedException e) { LOG.error("Awoken", e); } try { connection.close(); LOG.debug("Connection closed after " + (System.currentTimeMillis() - startTime) + " milliseconds."); } catch (SQLException e) { LOG.error("Problem closing connection", e); } } } } /* Revision history: $Log: ConnectionPoolTest.java,v $ Revision 1.1 2003/10/26 16:10:46 billhorsman renamed to be more consistent Revision 1.9 2003/09/11 23:14:57 billhorsman New test for when maximum-connection-count = 1 and minimum-connection-count = 1 Revision 1.8 2003/03/12 00:14:12 billhorsman change thresholds Revision 1.7 2003/03/11 01:19:48 billhorsman new tests Revision 1.6 2003/03/10 15:31:26 billhorsman fixes Revision 1.5 2003/03/04 10:24:40 billhorsman removed try blocks around each test Revision 1.4 2003/03/03 17:08:55 billhorsman all tests now extend AbstractProxoolTest Revision 1.3 2003/03/03 11:12:04 billhorsman fixed licence Revision 1.2 2003/03/01 15:27:24 billhorsman checkstyle Revision 1.1 2003/02/27 18:01:47 billhorsman completely rethought the test structure. it's now more obvious. no new tests yet though. */ --- ConnectionPoolTests.java DELETED --- |
From: <bil...@us...> - 2003-10-26 15:35:27
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv16169 Modified Files: build.xml Log Message: 0.8.0 Index: build.xml =================================================================== RCS file: /cvsroot/proxool/proxool/build.xml,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** build.xml 25 Oct 2003 18:39:11 -0000 1.64 --- build.xml 26 Oct 2003 15:33:27 -0000 1.65 *************** *** 27,31 **** <!-- Currect release, e.g. 0.6 --> ! <property name="release" value="0.8.0RC2"/> <!-- Currect release, e.g. 0.6 --> --- 27,31 ---- <!-- Currect release, e.g. 0.6 --> ! <property name="release" value="0.8.0"/> <!-- Currect release, e.g. 0.6 --> |
From: <bil...@us...> - 2003-10-26 15:27:41
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14569 Modified Files: CHANGES.txt Log Message: 0.8.0 Index: CHANGES.txt =================================================================== RCS file: /cvsroot/proxool/proxool/CHANGES.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CHANGES.txt 18 Oct 2003 20:45:05 -0000 1.27 --- CHANGES.txt 26 Oct 2003 15:23:53 -0000 1.28 *************** *** 6,10 **** $Author$ ! 0.8.0 - (October, 2003) - We now use Cglib's proxy library. Together with dropping the use of Timer --- 6,10 ---- $Author$ ! 0.8.0 - (26 October, 2003) - We now use Cglib's proxy library. Together with dropping the use of Timer *************** *** 18,22 **** to the delegate (third party) driver if you really need it. This makes your project dependent on both Proxool (to a small extent) and your ! third party driver (to a bigger extent) so should be done on if necessary. --- 18,22 ---- to the delegate (third party) driver if you really need it. This makes your project dependent on both Proxool (to a small extent) and your ! third party driver (to a bigger extent) so should be done only if necessary. *************** *** 36,40 **** - Added fatal-sql-exception-wrapper-class property. If a fatal exception is detected then it is wrapped up inside the exception defined by this ! property. This can make exception handling easier is frameworks like Struts. Two wrappers are provided (FataSQLException and FatalRuntimeException) but you can also define your own. --- 36,40 ---- - Added fatal-sql-exception-wrapper-class property. If a fatal exception is detected then it is wrapped up inside the exception defined by this ! property. This can make exception handling easier in frameworks like Struts. Two wrappers are provided (FataSQLException and FatalRuntimeException) but you can also define your own. *************** *** 62,66 **** explicitly in your code. ! - Made the 'Attempt to use a pool with incomplete definition' exception a but more informative. It is often because you are refering to an unregistered pool by its alias. --- 62,66 ---- explicitly in your code. ! - Made the 'Attempt to use a pool with incomplete definition' exception a bit more informative. It is often because you are refering to an unregistered pool by its alias. |
From: <bil...@us...> - 2003-10-26 15:24:38
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14481/src/java/org/logicalcobwebs/proxool Modified Files: Version.java Log Message: 0.8.0 Index: Version.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/Version.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Version.java 1 Oct 2003 19:31:26 -0000 1.14 --- Version.java 26 Oct 2003 15:23:30 -0000 1.15 *************** *** 40,44 **** private static final String BUILD_DATE = null; ! private static final String CVS = "0.8.0RC2+"; public static String getVersion() { --- 40,44 ---- private static final String BUILD_DATE = null; ! private static final String CVS = "0.8.0+"; public static String getVersion() { *************** *** 77,80 **** --- 77,83 ---- Revision history: $Log$ + Revision 1.15 2003/10/26 15:23:30 billhorsman + 0.8.0 + Revision 1.14 2003/10/01 19:31:26 billhorsman 0.8.0RC2 |
From: <bil...@us...> - 2003-10-25 18:42:50
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv29831 Modified Files: build.xml Log Message: Ignore all abstract classes during production of test report Index: build.xml =================================================================== RCS file: /cvsroot/proxool/proxool/build.xml,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** build.xml 7 Oct 2003 21:56:40 -0000 1.63 --- build.xml 25 Oct 2003 18:39:11 -0000 1.64 *************** *** 291,295 **** <fileset dir="src/java-test" includes="**/*Test.java" ! excludes="**/GlobalTest.java,**/AbstractProxoolTest.java,**/PerformanceTest.java" /> </batchtest> --- 291,295 ---- <fileset dir="src/java-test" includes="**/*Test.java" ! excludes="**/GlobalTest.java,**/Abstract*,**/PerformanceTest.java" /> </batchtest> |
From: <bil...@us...> - 2003-10-25 18:42:12
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv29704/src/java-test/org/logicalcobwebs/proxool Added Files: DependencyCheck.java Log Message: Not a test, just a standalone class you can run to see what libraries you need to use Proxool. It just checks the core features - you're gonna need other libraries for things like JAXP configuration, etc. --- NEW FILE: DependencyCheck.java --- /* * This software is released under a licence similar to the Apache Software Licence. * See org.logicalcobwebs.proxool.package.html for details. * The latest version is available at http://proxool.sourceforge.net */ package org.logicalcobwebs.proxool; import org.logicalcobwebs.logging.Log; import org.logicalcobwebs.logging.LogFactory; import org.logicalcobwebs.logging.impl.SimpleLog; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; /** * A minimal check to see what libraries we need to include with * our binary distribution * * @version $Revision: 1.1 $, $Date: 2003/10/25 18:38:17 $ * @author Bill Horsman {bi...@lo...) * @author $Author: billhorsman $ (current maintainer) * @since Proxool 0.8 */ public class DependencyCheck { /** * A minimal check to see what libraries we need to include with * our binary distribution */ public static void main(String[] args) { try { System.setProperty("org.apache.commons.logging.Log", SimpleLog.class.getName()); System.setProperty(Log.class.getName(), SimpleLog.class.getName()); System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug"); Log log = LogFactory.getLog(DependencyCheck.class); log.info("Can you read this?"); log.debug("Can you read this?"); Class.forName(ProxoolDriver.class.getName()); String alias = "dependencyCheck"; String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); DriverManager.getConnection(url, info).close(); System.out.println("Done"); } catch (Throwable e) { if (e instanceof ProxoolException) { e = ((ProxoolException) e).getCause(); } e.printStackTrace(); System.out.println("Fail"); } finally { ProxoolFacade.shutdown(0); } } } /* Revision history: $Log: DependencyCheck.java,v $ Revision 1.1 2003/10/25 18:38:17 billhorsman Not a test, just a standalone class you can run to see what libraries you need to use Proxool. It just checks the core features - you're gonna need other libraries for things like JAXP configuration, etc. */ |
From: <ch...@us...> - 2003-10-25 08:27:20
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/resources In directory sc8-pr-cvs1:/tmp/cvs-serv6198 Modified Files: attributeDescriptions.properties Log Message: Added descriptions for test-before/after-use properties. Index: attributeDescriptions.properties =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/resources/attributeDescriptions.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** attributeDescriptions.properties 30 Sep 2003 18:38:17 -0000 1.4 --- attributeDescriptions.properties 23 Oct 2003 23:18:17 -0000 1.5 *************** *** 33,38 **** If not defined then this test is omitted. - test-before-use - maximum-active-time=\ If the housekeeper comes across a thread that has been active for longer than \ --- 33,36 ---- *************** *** 99,100 **** --- 97,108 ---- Whether statistics are logged as they are produced. \ Range: DEBUG, INFO, WARN, ERROR, FATAL. Default is null (no logging). + + test-after-use=\ + If you set this to true then each connection is tested (with whatever is defined in \ + house-keeping-test-sql) after it is closed (that is, returned to the connection pool). \ + If a connection fails then it is discarded. + + test-before-use=\ + If you set this to true then each connection is tested (with whatever is defined in house-keeping-test-sql) \ + before being served. If a connection fails then it is discarded and another one is picked. If all \ + connections fail a new one is built. If that one fails then you get an SQLException saying so. \ No newline at end of file |
From: <bil...@us...> - 2003-10-24 18:23:08
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv31153/src/java/org/logicalcobwebs/proxool Modified Files: ConnectionPoolDefinition.java Log Message: Fixed bug where connection pool was being recognised as changed even when it wasn't. (This bug introduced after 0.7.2). Index: ConnectionPoolDefinition.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinition.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ConnectionPoolDefinition.java 20 Oct 2003 11:40:53 -0000 1.27 --- ConnectionPoolDefinition.java 24 Oct 2003 15:22:21 -0000 1.28 *************** *** 254,257 **** --- 254,263 ---- boolean proxoolProperty = true; boolean changed = false; + + // These groups of properties have been split off to make this method smaller + changed = changed || setHouseKeeperProperty(key, value, pretend); + changed = changed || setLoggingProperty(key, value, pretend); + changed = changed || setJndiProperty(key, value, pretend); + if (key.equals(ProxoolConstants.USER_PROPERTY)) { proxoolProperty = false; *************** *** 284,289 **** } } - } else if (setHouseKeeperProperty(key, value, pretend)) { - changed = true; } else if (key.equals(ProxoolConstants.MAXIMUM_CONNECTION_COUNT_PROPERTY)) { if (getMaximumConnectionCount() != getInt(key, value)) { --- 290,293 ---- *************** *** 348,353 **** } } - } else if (setLoggingProperty(key, value, pretend)) { - changed = true; } else if (key.equals(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY)) { if (isChanged(fatalSqlExceptionsAsString, value)) { --- 352,355 ---- *************** *** 378,384 **** } } ! } else if (setJndiProperty(key, value, pretend)) { ! changed = true; ! } else { if (isChanged(getDelegateProperty(key), value)) { changed = true; --- 380,386 ---- } } ! } ! ! if (key.startsWith(ProxoolConstants.PROPERTY_PREFIX)) { if (isChanged(getDelegateProperty(key), value)) { changed = true; *************** *** 389,392 **** --- 391,395 ---- proxoolProperty = false; } + if (changed && !pretend) { logChange(proxoolProperty, key, value); *************** *** 1129,1132 **** --- 1132,1138 ---- Revision history: $Log$ + Revision 1.28 2003/10/24 15:22:21 billhorsman + Fixed bug where connection pool was being recognised as changed even when it wasn't. (This bug introduced after 0.7.2). + Revision 1.27 2003/10/20 11:40:53 billhorsman Smarter handling of null and empty strings. No NPE during unit tests now. |