db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r521524 - in /db/ojb/trunk/src: java/org/apache/ojb/broker/accesslayer/ java/org/apache/ojb/broker/core/ java/org/apache/ojb/odmg/oql/ java/org/apache/ojb/soda/ test/org/apache/ojb/broker/ test/org/apache/ojb/broker/metadata/
Date Thu, 22 Mar 2007 23:12:22 GMT
Author: arminw
Date: Thu Mar 22 16:12:21 2007
New Revision: 521524

URL: http://svn.apache.org/viewvc?view=rev&rev=521524
Log:
replace (deprecate) method OJBIterator.releaseDbResources() with OJBIterator.close()

Modified:
    db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/OJBIterator.java
    db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java
    db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
    db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
    db/ojb/trunk/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java
    db/ojb/trunk/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java
    db/ojb/trunk/src/java/org/apache/ojb/soda/ObjectSetImpl.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/PaginationTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/RsIteratorTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/OJBIterator.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/OJBIterator.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/OJBIterator.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/OJBIterator.java Thu Mar 22 16:12:21
2007
@@ -136,7 +136,7 @@
      * </p>
      *
      * @param autoRelease Flag to set resource cleanup behavior.
-     * @see #releaseDbResources()
+     * @see #close()
      * @deprecated please use {@link #setAutoClose(boolean)}
      */
     void setAutoRelease(boolean autoRelease);

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java Thu Mar 22
16:12:21 2007
@@ -169,9 +169,6 @@
         return result;
     }
 
-    /**
-	 * @see org.apache.ojb.broker.accesslayer.OJBIterator#releaseDbResources()
-	 */
     public void releaseDbResources()
     {
         close();
@@ -198,7 +195,7 @@
         boolean result = m_currentCursorPosition <= m_endAt && m_iterator.hasNext();
         if(!result)
         {
-            releaseDbResources();
+            close();
         }
         return result;
     }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java Thu Mar 22 16:12:21
2007
@@ -852,7 +852,7 @@
     {
         if(autoClose)
         {
-            releaseDbResources();
+            close();
         }
     }
 
@@ -897,7 +897,7 @@
         {
             logger.info("Found unclosed resources while finalize (causer class: " + this.getClass().getName()
+ ")" +
                     " Do automatic cleanup");
-            releaseDbResources();
+            close();
         }
         try
         {

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java Thu Mar 22
16:12:21 2007
@@ -2112,7 +2112,7 @@
             } // make sure that we close the used resources
             finally
             {
-                if(it != null) it.releaseDbResources();
+                if(it != null) it.close();
             }
         }
         return result;
@@ -2493,7 +2493,7 @@
         {
             if (iter instanceof OJBIterator)
             {
-                ((OJBIterator) iter).releaseDbResources();
+                ((OJBIterator) iter).close();
             }
         }
 

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java Thu Mar 22
16:12:21 2007
@@ -236,7 +236,7 @@
         {
             if (iter != null)
             {
-                iter.releaseDbResources();
+                iter.close();
             }
             if (isRetrievalTasksCreated)
             {

Modified: db/ojb/trunk/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java Thu Mar 22 16:12:21 2007
@@ -280,7 +280,7 @@
                 {
                     if (iter instanceof OJBIterator)
                     {
-                        ((OJBIterator) iter).releaseDbResources();
+                        ((OJBIterator) iter).close();
                     }
                 }
             }

Modified: db/ojb/trunk/src/java/org/apache/ojb/soda/ObjectSetImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/soda/ObjectSetImpl.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/soda/ObjectSetImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/soda/ObjectSetImpl.java Thu Mar 22 16:12:21 2007
@@ -83,8 +83,7 @@
             }
             else
             {
-                boolean result = ojbIterator.hasNext();
-             	return result;
+                return ojbIterator.hasNext();
             }
         }
         else
@@ -101,7 +100,7 @@
         {
             if (ojbIterator instanceof RsIterator)
             {
-                ((RsIterator) ojbIterator).releaseDbResources();
+                ((RsIterator) ojbIterator).close();
             }
             setResultSetClosed(true);
         }

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/PaginationTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/PaginationTest.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/PaginationTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/PaginationTest.java Thu Mar 22 16:12:21 2007
@@ -515,7 +515,7 @@
                 }
             }
             // manually release used resources
-            ojbIterator.releaseDbResources();
+            ojbIterator.close();
 
 
             // -------------------------------------------------------------
@@ -561,7 +561,7 @@
                 }
             }
             // manually release used resources
-            ojbIterator.releaseDbResources();
+            ojbIterator.close();
 
 
             // -------------------------------------------------------------
@@ -606,7 +606,7 @@
                 }
             }
             // manually release used resources
-            ojbIterator.releaseDbResources();
+            ojbIterator.close();
 
 
             // -------------------------------------------------------------
@@ -653,7 +653,7 @@
                 }
             }
             // manually release used resources
-            ojbIterator.releaseDbResources();
+            ojbIterator.close();
         }
         finally
         {
@@ -861,7 +861,7 @@
         query.setEndAtIndex(fullSize + 14);
         ojbIter = broker.getIteratorByQuery(query);
         assertEquals("indices out of range expecting 0 rows", 0,ojbIter.size());
-        ojbIter.releaseDbResources();
+        ojbIter.close();
     }
 
     public void testPagingEndIndexOutOfRange()
@@ -887,7 +887,7 @@
         query.setEndAtIndex(fullSize + 9);
         ojbIter = broker.getIteratorByQuery(query);
         assertEquals("end index out of range expecting 0 rows", 10,ojbIter.size());
-        ojbIter.releaseDbResources();
+        ojbIter.close();
     }
 
     public void testPagingEmptyIterator()
@@ -913,7 +913,7 @@
         query.setEndAtIndex(14);
         ojbIter = broker.getIteratorByQuery(query);
         assertEquals("index 10 - 14 expecting 0 rows for empty iterator", 0,ojbIter.size());
-        ojbIter.releaseDbResources();
+        ojbIter.close();
     }
 
     private Article createArticle(ProductGroup group, String name)

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java Thu Mar 22 16:12:21
2007
@@ -1214,7 +1214,7 @@
         OJBIterator ojbIter = (OJBIterator)broker.getIteratorByQuery(query);
         assertEquals("size of iterator should be one", 1, ojbIter.size());
         InterfaceArticle test4 = (InterfaceArticle) ojbIter.next();
-        ojbIter.releaseDbResources();
+        ojbIter.close();
         assertTrue("Id should be a number of the generated articles", range.containsInteger(test4.getArticleId()));
     }
 
@@ -1774,6 +1774,6 @@
         iterSize = ojbIter.size();
 
         assertEquals("collSize == iterSize", collSize , iterSize);
-        ojbIter.releaseDbResources();
+        ojbIter.close();
     }
 }

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/RsIteratorTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/RsIteratorTest.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/RsIteratorTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/RsIteratorTest.java Thu Mar 22 16:12:21 2007
@@ -278,7 +278,7 @@
         {
             it.next();
             assertTrue(true);
-            it.releaseDbResources();
+            it.close();
             it.hasNext();
 
             fail("We expect RsIterator has released resources...");
@@ -303,7 +303,7 @@
             it.hasNext();
             it.next();
             assertTrue(true);
-            it.releaseDbResources();
+            it.close();
             it.hasNext();
             fail("We expect RsIterator has released resources..");
         }
@@ -348,7 +348,7 @@
         }
 
         // TODO: Remove this cast one day
-        it.releaseDbResources();
+        it.close();
         assertTrue(it.isClosed());
     }
 

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java?view=diff&rev=521524&r1=521523&r2=521524
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java Thu
Mar 22 16:12:21 2007
@@ -118,7 +118,7 @@
                 //System.err.println("------");
             }
             assertNotNull("Should get metadata exception from proxy", expectedThrowable);
-            groupIter.releaseDbResources();
+            groupIter.close();
 
             // Load the repository profile and re-try loading.
             Iterator proxyIter;



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message