diff options
author | Benoit Foucher <benoit@zeroc.com> | 2010-01-05 15:03:03 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2010-01-05 15:03:03 +0100 |
commit | 2eb6a2e5c43a04bc8ea3c72dd3aadc82fa9e430c (patch) | |
tree | b179b72766a60db1a2fcb362089726793b5d9655 /cpp/src/Freeze/SharedDbEnv.cpp | |
parent | Bug 4538 - update instructions for building berkeley on windows (diff) | |
download | ice-2eb6a2e5c43a04bc8ea3c72dd3aadc82fa9e430c.tar.bz2 ice-2eb6a2e5c43a04bc8ea3c72dd3aadc82fa9e430c.tar.xz ice-2eb6a2e5c43a04bc8ea3c72dd3aadc82fa9e430c.zip |
Fix for bug 4538 -- Freeze file lock is now stored in __Freeze subdirectory
Diffstat (limited to 'cpp/src/Freeze/SharedDbEnv.cpp')
-rw-r--r-- | cpp/src/Freeze/SharedDbEnv.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/Freeze/SharedDbEnv.cpp b/cpp/src/Freeze/SharedDbEnv.cpp index 5156b52aa00..840aa25268d 100644 --- a/cpp/src/Freeze/SharedDbEnv.cpp +++ b/cpp/src/Freeze/SharedDbEnv.cpp @@ -486,9 +486,16 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName, string dbHome = properties->getPropertyWithDefault(propertyPrefix + ".DbHome", envName); // - // File lock to prevent multiple process open the same db env. + // File lock to prevent multiple process open the same db env. We create the lock + // file in a sub-directory to ensure db_hotbackup won't try to copy the file when + // backing up the environment (this would fail on Windows where copying a locked + // file isn't possible). // - _fileLock = new ::IceUtilInternal::FileLock(dbHome + "/Freeze.lock"); + if(!::IceUtilInternal::directoryExists(dbHome + "/__Freeze")) + { + ::IceUtilInternal::mkdir(dbHome + "/__Freeze", 0777); + } + _fileLock = new ::IceUtilInternal::FileLock(dbHome + "/__Freeze/lock"); _trace = properties->getPropertyAsInt("Freeze.Trace.DbEnv"); |