jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1165319 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
Date Mon, 05 Sep 2011 15:11:38 GMT
Author: thomasm
Date: Mon Sep  5 15:11:38 2011
New Revision: 1165319

URL: http://svn.apache.org/viewvc?rev=1165319&view=rev
Log:
Support faster database operations using -Dmk.fastDb=true (disable transaction log and undo
log)

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java?rev=1165319&r1=1165318&r2=1165319&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
Mon Sep  5 15:11:38 2011
@@ -26,14 +26,11 @@ import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.PrintStream;
-import java.io.Writer;
 import java.security.DigestOutputStream;
 import java.security.MessageDigest;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
-import java.sql.SQLException;
 import java.sql.Statement;
 
 /**
@@ -41,6 +38,8 @@ import java.sql.Statement;
  */
 public class H2RevisionStore extends AbstractRevisionStore implements BlobStore {
 
+    private static final boolean FAST = Boolean.getBoolean("mk.fastDb");
+
     private boolean initialized;
 
     private JdbcConnectionPool cp;
@@ -63,7 +62,11 @@ public class H2RevisionStore extends Abs
         }
 
         Class.forName("org.h2.Driver");
-        cp = JdbcConnectionPool.create("jdbc:h2:" + dbDir.getCanonicalPath() + "/revs", "sa",
"");
+        String url = "jdbc:h2:" + dbDir.getCanonicalPath() + "/revs";
+        if (FAST) {
+            url += ";log=0;undo_log=0";
+        }
+        cp = JdbcConnectionPool.create(url, "sa", "");
         cp.setMaxConnections(40);
         Connection con = cp.getConnection();
         try {



Mime
View raw message