You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2006/02/10 23:00:12 UTC

svn commit: r376874 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java

Author: kmarsden
Date: Fri Feb 10 14:00:11 2006
New Revision: 376874

URL: http://svn.apache.org/viewcvs?rev=376874&view=rev
Log:
DERBY-210 cleanup patch in preparation for change
Attaching a patch 'derby-210-patch1.diff' which removes the list 'RollbackOnlyListeners_' from org.apache.derby.client.am.Connection class since this is not being used. This is an incremental patch and does not solve the issue fully.

While working on this issue, I found one of the causes of memory leaks is object references stored in the lists in the Connection class. On looking at the lists, I found that 'RollbackOnlyListeners' is not being used anywhere in the client code. Submitting this patch to remove this. 

Contributed by Deepa Remesh


Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java?rev=376874&r1=376873&r2=376874&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java Fri Feb 10 14:00:11 2006
@@ -38,14 +38,12 @@
     // that they are now in an un-prepared state.
     final java.util.LinkedList openStatements_ = new java.util.LinkedList();
 
-    // Some statuses of DERBY objects may be invalid on server either after only rollback
-    // or after both commit and rollback. For example,
+    // Some statuses of DERBY objects may be invalid on server
+    // after both commit and rollback. For example,
     // (1) prepared statements need to be re-prepared
     //     after both commit and rollback
     // (2) result set will be unpositioned on server after both commit and rollback.
-    // If they only depend on rollback, they need to get on RollbackOnlyListeners_.
     // If they depend on both commit and rollback, they need to get on CommitAndRollbackListeners_.
-    final java.util.LinkedList RollbackOnlyListeners_ = new java.util.LinkedList();
     final java.util.LinkedList CommitAndRollbackListeners_ = new java.util.LinkedList();
     private SqlWarning warnings_ = null;
 
@@ -807,7 +805,6 @@
         inUnitOfWork_ = false;
         markStatementsClosed();
         CommitAndRollbackListeners_.clear();
-        RollbackOnlyListeners_.clear();
         markClosed_();
     }
 
@@ -1709,10 +1706,6 @@
     // This method will only throw an exception on bug check.
     public void completeLocalRollback() {
         for (java.util.Iterator i = CommitAndRollbackListeners_.iterator(); i.hasNext();) {
-            UnitOfWorkListener listener = (UnitOfWorkListener) i.next();
-            listener.completeLocalRollback(i);
-        }
-        for (java.util.Iterator i = RollbackOnlyListeners_.iterator(); i.hasNext();) {
             UnitOfWorkListener listener = (UnitOfWorkListener) i.next();
             listener.completeLocalRollback(i);
         }