diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Freeze/SharedDbEnv.cpp | 11 | ||||
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 2 |
2 files changed, 10 insertions, 3 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"); diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 120df689b6a..ef71281b185 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -1262,7 +1262,6 @@ NodeI::canRemoveServerDirectory(const string& name) Ice::StringSeq c = readDirectory(_serversDir + "/" + name); set<string> contents(c.begin(), c.end()); contents.erase("dbs"); - contents.erase("dbs"); contents.erase("config"); contents.erase("distrib"); contents.erase("revision"); @@ -1288,6 +1287,7 @@ NodeI::canRemoveServerDirectory(const string& name) { Ice::StringSeq files = readDirectory(_serversDir + "/" + name + "/dbs/" + *p); files.erase(remove(files.begin(), files.end(), "DB_CONFIG"), files.end()); + files.erase(remove(files.begin(), files.end(), "__Freeze"), files.end()); if(!files.empty()) { return false; |