Author: rvesse
Date: Tue Jul 22 09:39:31 2014
New Revision: 1612519

URL: http://svn.apache.org/r1612519
Log:
Enable multi-JVM use prevention (JENA-648)

Modified:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SystemTDB.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SystemTDB.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SystemTDB.java?rev=1612519&r1=1612518&r2=1612519&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SystemTDB.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SystemTDB.java 
Tue Jul 22 09:39:31 2014
@@ -236,16 +236,13 @@ public class SystemTDB
     public static boolean Checking = false ;       // This isn't used enough!
     
     /**
-     * New feature introduced by JENA-648 to help prevent one common cause of 
JVM corruption.
+     * New feature introduced by JENA-648 to help prevent one common cause of 
TDB corruption.
      * <p>
      * When enabled lock files are written to disk locations with the current 
owner process PID,
      * other processes will refuse to access that location while another live 
process owns the PID.
      * </p>
-     * <p>
-     * Currently off by default as the new code stabilises and is debugged
-     * </p>
      */
-    public static boolean DiskLocationMultiJvmUsagePrevention = false;
+    public static boolean DiskLocationMultiJvmUsagePrevention = true;
 
     // BDB related.
     //public static final int BDB_cacheSizePercent    = 
intValue("BDB_cacheSizePercent", 75) ;

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java?rev=1612519&r1=1612518&r2=1612519&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
 Tue Jul 22 09:39:31 2014
@@ -4,7 +4,6 @@ import java.io.BufferedWriter;
 import java.io.FileWriter;
 import java.io.IOException;
 
-import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.BeforeClass;
@@ -15,7 +14,6 @@ import org.junit.rules.TemporaryFolder;
 import com.hp.hpl.jena.tdb.StoreConnection;
 import com.hp.hpl.jena.tdb.TDBException;
 import com.hp.hpl.jena.tdb.sys.ProcessUtils;
-import com.hp.hpl.jena.tdb.sys.SystemTDB;
 
 /**
  * Tests for {@link LocationLock}
@@ -29,14 +27,8 @@ public class TestLocationLock {
     
     @BeforeClass
     public static void setup() {
-        SystemTDB.DiskLocationMultiJvmUsagePrevention = true;
         negativePidsTreatedAsAlive = ProcessUtils.negativePidsTreatedAsAlive();
     }
-    
-    @AfterClass
-    public static void teardown() {
-        SystemTDB.DiskLocationMultiJvmUsagePrevention = false;
-    }
 
     @Test
     public void location_lock_mem() {
@@ -158,7 +150,7 @@ public class TestLocationLock {
         Assert.assertFalse(lock.isOwned());
 
         // Attempting to release a lock we don't own should error
-        Assert.assertFalse(lock.canObtain()); // Returns true on Jenkins
+        Assert.assertFalse(lock.canObtain());
         lock.release();
     }
 
@@ -183,6 +175,6 @@ public class TestLocationLock {
         Assert.assertFalse(lock.isOwned());
 
         // Attempting to create a connection on this location should error
-        StoreConnection.make(dir); // Doesn't error on Jenkins
+        StoreConnection.make(dir);
     }
 }


Reply via email to