db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1207729 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/io/ engine/org/apache/derby/impl/services/monitor/ engine/org/apache/derby/io/ testing/org/apache/derbyTesting/functionTests/util/corruptio/
Date Tue, 29 Nov 2011 01:36:14 GMT
Author: kmarsden
Date: Tue Nov 29 01:36:12 2011
New Revision: 1207729

URL: http://svn.apache.org/viewvc?rev=1207729&view=rev
Log:
DERBY-5096 DisconnectException: "Connection was refused because the database DB was not found"
when creating db for first time

Patch adjusts the canonicalName after mkdirs() if it does not match getCanonicalPAth()



Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/BaseStorageFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
    db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFactory.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptBaseStorageFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/BaseStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/BaseStorageFactory.java?rev=1207729&r1=1207728&r2=1207729&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/BaseStorageFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/BaseStorageFactory.java Tue Nov
29 01:36:12 2011
@@ -111,6 +111,15 @@ abstract class BaseStorageFactory implem
     }
     
     /**
+     * Set the canonicalName. May need adjustment due to DERBY-5096
+     * 
+     * @param name uniquely identifiable name for this database
+     */
+    public void setCanonicalName(String name) {
+       canonicalName = name;
+    }
+    
+    /**
      * Construct a StorageFile from a path name.
      *
      * @param path The path name of the file

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java?rev=1207729&r1=1207728&r2=1207729&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java Tue
Nov 29 01:36:12 2011
@@ -190,6 +190,15 @@ public class VFMemoryStorageFactory
     }
 
     /**
+     * Set the canonicalName. May need adjustment due to DERBY-5096
+     * 
+     * @param name uniquely identifiable name for this database
+     */
+    public void setCanonicalName(String name) {
+       canonicalName = name;
+    }
+    
+    /**
      * Returns a handle to the specific storage file.
      *
      * @param path the path of the file or directory

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java?rev=1207729&r1=1207728&r2=1207729&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
Tue Nov 29 01:36:12 2011
@@ -760,7 +760,12 @@ final class StorageFactoryService implem
                             if (serviceDirectory.mkdirs())
                             {
                                 serviceDirectory.limitAccessToOwner();
-
+                                // DERBY-5096 On iseries, the storageFactory canonicalName
may need to be adjusted
+                                // for casing after the directory is created.
+                                String serviceDirCanonicalPath = serviceDirectory.getCanonicalPath();
+                                if (storageFactory.getCanonicalName() != serviceDirCanonicalPath)
{
+                                    storageFactory.setCanonicalName(serviceDirCanonicalPath);
+                                }
                                 try
                                 {
                                     return storageFactory.getCanonicalName();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFactory.java?rev=1207729&r1=1207728&r2=1207729&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFactory.java Tue Nov 29 01:36:12
2011
@@ -231,4 +231,12 @@ public interface StorageFactory
      */
     public StorageFile createTemporaryFile (String prefix, String suffix)
                                                             throws IOException;
+    
+    /**
+     * Set the canonicalName. May need adjustment due to DERBY-5096
+     * 
+     * @param name uniquely identifiable name for this database
+     */
+    public void setCanonicalName(String name);
+    
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptBaseStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptBaseStorageFactory.java?rev=1207729&r1=1207728&r2=1207729&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptBaseStorageFactory.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptBaseStorageFactory.java
Tue Nov 29 01:36:12 2011
@@ -118,6 +118,15 @@ abstract class CorruptBaseStorageFactory
     }
     
     /**
+     * Set the canonicalName. May need adjustment due to DERBY-5096
+     * 
+     * @param name uniquely identifiable name for this database
+     */
+    public void setCanonicalName(String name) {
+       realStorageFactory.setCanonicalName(name);
+    }
+    
+    /**
      * Construct a StorageFile from a path name.
      *
      * @param path The path name of the file



Mime
View raw message