db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r805454 - in /db/derby/code/branches/10.5/java: engine/org/apache/derby/impl/io/ testing/org/apache/derbyTesting/functionTests/tests/store/ testing/org/apache/derbyTesting/junit/
Date Tue, 18 Aug 2009 15:32:43 GMT
Author: rhillegas
Date: Tue Aug 18 15:32:42 2009
New Revision: 805454

URL: http://svn.apache.org/viewvc?rev=805454&view=rev
Log:
DERBY-700: Port 805448 from trunk to 10.5 branch.

Added:
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClassLoaderBootTest.java
      - copied unchanged from r805448, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClassLoaderBootTest.java
Modified:
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/io/DirFile4.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/io/DirFile4.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/io/DirFile4.java?rev=805454&r1=805453&r2=805454&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/io/DirFile4.java (original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/io/DirFile4.java Tue Aug
18 15:32:42 2009
@@ -33,6 +33,7 @@
 import java.io.RandomAccessFile;
 import java.nio.channels.FileChannel;
 import java.nio.channels.FileLock;
+import java.nio.channels.OverlappingFileLockException;
 
 /**
  * This class implements the StorageFile interface using features of Java 1.4 not available
in earlier
@@ -186,7 +187,31 @@
 				SanityManager.THROWASSERT("Unable to Acquire Exclusive Lock on "
 										  + getPath(), ioe);
 			}
-		}
+		} catch (OverlappingFileLockException ofle)
+        {
+            //
+            // Under Java 6 and later, this exception is raised if the database
+            // has been opened by another Derby instance in a different
+            // ClassLoader in this VM. See DERBY-700.
+            //
+            // The OverlappingFileLockException is raised by the
+            // lockFileChannel.tryLock() call above.
+            //
+            try {
+                lockFileChannel.close();
+                lockFileOpen.close();
+            } catch (IOException e)
+            {
+                if (SanityManager.DEBUG)
+                {
+                    SanityManager.THROWASSERT("Error closing file channel "
+                                              + getPath(), e);
+                }
+            }
+            lockFileChannel=null;
+            lockFileOpen = null;
+            status = EXCLUSIVE_FILE_LOCK_NOT_AVAILABLE;
+        }
     
 		return status;
 	} // end of getExclusiveFileLock

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java?rev=805454&r1=805453&r2=805454&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
(original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
Tue Aug 18 15:32:42 2009
@@ -52,6 +52,7 @@
         TestSuite suite = new TestSuite("store");
         
         suite.addTest(BootAllTest.suite());
+        suite.addTest(ClassLoaderBootTest.suite());
         suite.addTest(StreamingColumnTest.suite());
         suite.addTest(Derby3625Test.suite());
         suite.addTest(PositionedStoreStreamTest.suite());

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=805454&r1=805453&r2=805454&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java Tue Aug
18 15:32:42 2009
@@ -1,6 +1,6 @@
 /*
  *
- * Derby - Class org.apache.derbyTesting.functionTests.util.JDBC
+ * Derby - Class org.apache.derbyTesting.junit.JDBC
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with



Mime
View raw message