jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1436921 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
Date Tue, 22 Jan 2013 13:43:36 GMT
Author: jukka
Date: Tue Jan 22 13:43:35 2013
New Revision: 1436921

URL: http://svn.apache.org/viewvc?rev=1436921&view=rev
Log:
JCR-3485: The Datastore garbage collector does not work with a Derby-based DbDataStore

Patch by C├ędric Damioli

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java?rev=1436921&r1=1436920&r2=1436921&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
Tue Jan 22 13:43:35 2013
@@ -320,7 +320,7 @@ public class DbDataStore implements Data
                     // SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID=?
                     rs = conHelper.query(selectMetaSQL, tempId);
                     boolean hasNext = rs.next();
-                    rs.close();
+                    DbUtility.close(rs);
                     rs = null;
                     if (hasNext) {
                         // re-try in the very, very unlikely event that the row already exists
@@ -446,6 +446,8 @@ public class DbDataStore implements Data
                     log.error(msg);
                     throw new DataStoreException(msg);
                 }
+                DbUtility.close(rs);
+                rs = null;
                 touch(identifier, lastModified);
                 // row already exists
                 conHelper.exec(deleteSQL, tempId);
@@ -546,6 +548,8 @@ public class DbDataStore implements Data
             }
             long length = rs.getLong(1);
             long lastModified = rs.getLong(2);
+            DbUtility.close(rs);
+            rs = null;
             touch(identifier, lastModified);
             return new DbDataRecord(this, identifier, length, lastModified);
         } catch (Exception e) {



Mime
View raw message