commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp DelegatingCallableStatement.java DelegatingConnection.java DelegatingPreparedStatement.java DelegatingStatement.java
Date Sat, 29 Jun 2002 17:36:38 GMT
glenn       2002/06/29 10:36:38

  Modified:    dbcp/src/java/org/apache/commons/dbcp
                        DelegatingCallableStatement.java
                        DelegatingConnection.java
                        DelegatingPreparedStatement.java
                        DelegatingStatement.java
  Log:
  Fix ConcurrentModificationException bug
  
  Revision  Changes    Path
  1.3       +7 -6      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java
  
  Index: DelegatingCallableStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DelegatingCallableStatement.java	29 May 2002 01:24:09 -0000	1.2
  +++ DelegatingCallableStatement.java	29 Jun 2002 17:36:37 -0000	1.3
  @@ -134,9 +134,10 @@
           // ResultSet's when it is closed.
           List resultSets = getTrace();
           if( resultSets != null) {
  -            Iterator it = resultSets.iterator();
  -            while(it.hasNext()) {
  -                ((ResultSet)it.next()).close();
  +            ResultSet[] set = new ResultSet[resultSets.size()];
  +            resultSets.toArray(set);
  +            for (int i = 0; i < set.length; i++) {
  +                set[i].close();
               }
               clearTrace();
           }
  
  
  
  1.7       +9 -8      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingConnection.java
  
  Index: DelegatingConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingConnection.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DelegatingConnection.java	29 Jun 2002 16:45:08 -0000	1.6
  +++ DelegatingConnection.java	29 Jun 2002 17:36:37 -0000	1.7
  @@ -259,12 +259,13 @@
           // Statement's when it is closed.
           List statements = getTrace();
           if( statements != null) {
  -            Iterator it = statements.iterator();
  -            while(it.hasNext()) {
  -                ((Statement)it.next()).close();
  +            Statement[] set = new Statement[statements.size()];
  +            statements.toArray(set);
  +            for (int i = 0; i < set.length; i++) {
  +                set[i].close();
               }
               clearTrace();
  -        }  
  +        }
           setLastUsed(0);
           if(_conn instanceof DelegatingConnection) {
               ((DelegatingConnection)_conn).passivate();
  
  
  
  1.5       +7 -6      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java
  
  Index: DelegatingPreparedStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DelegatingPreparedStatement.java	28 Jun 2002 15:28:20 -0000	1.4
  +++ DelegatingPreparedStatement.java	29 Jun 2002 17:36:37 -0000	1.5
  @@ -264,9 +264,10 @@
           // ResultSet's when it is closed.
           List resultSets = getTrace();
           if( resultSets != null) {
  -            Iterator it = resultSets.iterator();
  -            while(it.hasNext()) {
  -                ((ResultSet)it.next()).close();
  +            ResultSet[] set = new ResultSet[resultSets.size()];
  +            resultSets.toArray(set);
  +            for (int i = 0; i < set.length; i++) {
  +                set[i].close();
               }
               clearTrace();
           }
  
  
  
  1.5       +7 -6      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingStatement.java
  
  Index: DelegatingStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingStatement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DelegatingStatement.java	28 Jun 2002 15:28:20 -0000	1.4
  +++ DelegatingStatement.java	29 Jun 2002 17:36:37 -0000	1.5
  @@ -217,9 +217,10 @@
           // ResultSet's when it is closed.
           List resultSets = getTrace();
           if( resultSets != null) {
  -            Iterator it = resultSets.iterator();
  -            while(it.hasNext()) {
  -                ((ResultSet)it.next()).close();
  +            ResultSet[] set = new ResultSet[resultSets.size()];
  +            resultSets.toArray(set);
  +            for (int i = 0; i < set.length; i++) {
  +                set[i].close();
               }
               clearTrace();
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message