jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1593945 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java test/java/org/apache/jackrabbit/oak/plugins/document/blob/RDBBlobStoreTest.java
Date Mon, 12 May 2014 12:31:12 GMT
Author: reschke
Date: Mon May 12 12:31:12 2014
New Revision: 1593945

URL: http://svn.apache.org/r1593945
Log:
OAK-1811 - enable RDBBlobStore testing for non-H2 databases (through system properties), fix
potential problem in deleting blobs

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/blob/RDBBlobStoreTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java?rev=1593945&r1=1593944&r2=1593945&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
Mon May 12 12:31:12 2014
@@ -291,6 +291,13 @@ public class RDBBlobStore extends Cachin
 
     @Override
     public boolean deleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws
Exception {
+
+        // sanity check
+        if (chunkIds.isEmpty()) {
+            // sanity check, nothing to do
+            return true;
+        }
+
         Connection con = ds.getConnection();
         try {
             PreparedStatement prep = null;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/blob/RDBBlobStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/blob/RDBBlobStoreTest.java?rev=1593945&r1=1593944&r2=1593945&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/blob/RDBBlobStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/blob/RDBBlobStoreTest.java
Mon May 12 12:31:12 2014
@@ -34,10 +34,16 @@ public class RDBBlobStoreTest extends Ab
 
     private RDBBlobStore blobStore;
 
+    private static final String URL = System.getProperty("rdb.jdbc-url", "jdbc:h2:mem:oakblobs");
+
+    private static final String USERNAME = System.getProperty("rdb.jdbc-user", "sa");
+
+    private static final String PASSWD = System.getProperty("rdb.jdbc-passwd", "");
+
     @Before
     @Override
     public void setUp() throws Exception {
-        blobStore = new RDBBlobStore(RDBDataSourceFactory.forJdbcUrl("jdbc:h2:mem:oakblobs",
"sa", ""));
+        blobStore = new RDBBlobStore(RDBDataSourceFactory.forJdbcUrl(URL, USERNAME, PASSWD));
         blobStore.setBlockSize(128);
         blobStore.setBlockSizeMin(48);
         this.store = blobStore;



Mime
View raw message