You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2006/12/08 18:51:55 UTC

svn commit: r484672 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java

Author: djd
Date: Fri Dec  8 09:51:55 2006
New Revision: 484672

URL: http://svn.apache.org/viewvc?view=rev&rev=484672
Log:
DERBY-2083 Fix broken backup/restore tests. Caused by not updating path through code
when a service is directly accessed as a file rather than through the StorageFactory api.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java

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?view=diff&rev=484672&r1=484671&r2=484672
==============================================================================
--- 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 Fri Dec  8 09:51:55 2006
@@ -263,7 +263,12 @@
                         if( recreateFrom != null) // restore from a file
                         {
                             File propFile = new File(recreateFrom, PersistentService.PROPERTIES_NAME);
-                            return new FileInputStream(propFile);
+                            InputStream is = new FileInputStream(propFile);
+                            try {
+                                serviceProperties.load(new BufferedInputStream(is));
+                            } finally {
+                                is.close();
+                            }
                         }
                         else
                         {
@@ -281,8 +286,8 @@
                             } finally {
                                storageFactory.shutdown();
                             }
-                            return null;
                         }
+                        return null;
                     }
                 }
                 );