jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r738087 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
Date Tue, 27 Jan 2009 13:30:15 GMT
Author: thomasm
Date: Tue Jan 27 13:30:15 2009
New Revision: 738087

URL: http://svn.apache.org/viewvc?rev=738087&view=rev
Log:
JCR-1956 Database Data Store: close result sets

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=738087&r1=738086&r2=738087&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 27 13:30:15 2009
@@ -304,16 +304,20 @@
                     now = System.currentTimeMillis();
                     id = UUID.randomUUID().toString();
                     tempId = TEMP_PREFIX + id;
+                    // SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID=?
                     PreparedStatement prep = conn.executeStmt(selectMetaSQL, new Object[]{tempId});
                     rs = prep.getResultSet();
                     if (rs.next()) {
                         // re-try in the very, very unlikely event that the row already exists
                         continue;
                     }
+                    // INSERT INTO DATASTORE VALUES(?, 0, ?, NULL)
                     conn.executeStmt(insertTempSQL, new Object[]{tempId, new Long(now)});
                     break;
                 } catch (Exception e) {
                     throw convert("Can not insert new record", e);
+                } finally {
+                    DatabaseHelper.closeSilently(rs);
                 }
             }
             if (id == null) {
@@ -567,6 +571,8 @@
             boolean exists = rs.next();
             rs.close();
             if (!exists) {
+                // CREATE TABLE DATASTORE(ID VARCHAR(255) PRIMARY KEY, 
+                // LENGTH BIGINT, LAST_MODIFIED BIGINT, DATA BLOB)
                 conn.executeStmt(createTableSQL, null);
             }
             putBack(conn);



Mime
View raw message