summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/IcePackNode.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-02-14 09:58:18 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-02-14 09:58:18 +0000
commit0b3e545cb8f494752c1982aa504f4aa658ced475 (patch)
tree45c2bfeb2fc1e9e93cee2414ac34394c82f20350 /cpp/src/IcePack/IcePackNode.cpp
parentFixed warning with aCC (HP) (diff)
downloadice-0b3e545cb8f494752c1982aa504f4aa658ced475.tar.bz2
ice-0b3e545cb8f494752c1982aa504f4aa658ced475.tar.xz
ice-0b3e545cb8f494752c1982aa504f4aa658ced475.zip
Fixes to ensure that the evictor updates will be saved immediatly.
Diffstat (limited to 'cpp/src/IcePack/IcePackNode.cpp')
-rw-r--r--cpp/src/IcePack/IcePackNode.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/cpp/src/IcePack/IcePackNode.cpp b/cpp/src/IcePack/IcePackNode.cpp
index c7b7c80db16..fa14acda8df 100644
--- a/cpp/src/IcePack/IcePackNode.cpp
+++ b/cpp/src/IcePack/IcePackNode.cpp
@@ -227,8 +227,8 @@ IcePack::NodeService::start(int argc, char* argv[])
//
// Initialize the database environment (first setup the directory structure if needed).
//
- string envName;
string dataPath = properties->getProperty("IcePack.Node.Data");
+ string dbPath;
if(dataPath.empty())
{
error("property `IcePack.Node.Data' is not set");
@@ -261,22 +261,21 @@ IcePack::NodeService::start(int argc, char* argv[])
#endif
//
- // Creates subdirectories db and servers in the IcePack.Node.Data
- // directory if they don't already exist.
+ // Creates subdirectories db and servers in the IcePack.Node.Data directory if they don't already exist.
//
if(dataPath[dataPath.length() - 1] != '/')
{
dataPath += "/";
}
- envName = dataPath + "db";
+ dbPath = dataPath + "db";
string serversPath = dataPath + "servers";
string tmpPath = dataPath + "tmp";
#ifdef _WIN32
- if(::_stat(envName.c_str(), &filestat) != 0)
+ if(::_stat(dbPath.c_str(), &filestat) != 0)
{
- _mkdir(envName.c_str());
+ _mkdir(dbPath.c_str());
}
if(::_stat(serversPath.c_str(), &filestat) != 0)
{
@@ -287,9 +286,9 @@ IcePack::NodeService::start(int argc, char* argv[])
_mkdir(tmpPath.c_str());
}
#else
- if(::stat(envName.c_str(), &filestat) != 0)
+ if(::stat(dbPath.c_str(), &filestat) != 0)
{
- mkdir(envName.c_str(), 0755);
+ mkdir(dbPath.c_str(), 0755);
}
if(::stat(serversPath.c_str(), &filestat) != 0)
{
@@ -327,6 +326,12 @@ IcePack::NodeService::start(int argc, char* argv[])
}
//
+ // Setup the Freeze database environment home directory. The name of the database
+ // environment for the IcePack node is the name of the node.
+ //
+ properties->setProperty("Freeze.DbEnv." + name + ".DbHome", dbPath);
+
+ //
// Set the adapter id for this node and create the node object adapter.
//
properties->setProperty("IcePack.Node.AdapterId", "IcePack.Node." + name);
@@ -350,7 +355,7 @@ IcePack::NodeService::start(int argc, char* argv[])
// for the server and server adapter. It also takes care of installing the
// evictors and object factories necessary to store these objects.
//
- ServerFactoryPtr serverFactory = new ServerFactory(adapter, traceLevels, envName, _activator, _waitQueue);
+ ServerFactoryPtr serverFactory = new ServerFactory(adapter, traceLevels, name, _activator, _waitQueue);
NodePtr node = new NodeI(_activator, name, serverFactory, communicator(), properties);
Identity id = stringToIdentity(IceUtil::generateUUID());
adapter->add(node, id);