summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Database.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-01-02 11:27:04 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-01-02 11:27:04 +0000
commitf0505ac942eeb61779680b76f1d1e3b2e2f4e2f1 (patch)
treea41f29914aff715591ac167d1b624ac0dfc6efd9 /cpp/src/IceGrid/Database.cpp
parentRemoved .NET 1.1 and VS 2003 support. (diff)
downloadice-f0505ac942eeb61779680b76f1d1e3b2e2f4e2f1.tar.bz2
ice-f0505ac942eeb61779680b76f1d1e3b2e2f4e2f1.tar.xz
ice-f0505ac942eeb61779680b76f1d1e3b2e2f4e2f1.zip
Changes to support IceGrid database upgrade from 3.1 to 3.2
Diffstat (limited to 'cpp/src/IceGrid/Database.cpp')
-rw-r--r--cpp/src/IceGrid/Database.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp
index 6e5b1bd8885..dc76602b3f5 100644
--- a/cpp/src/IceGrid/Database.cpp
+++ b/cpp/src/IceGrid/Database.cpp
@@ -70,16 +70,32 @@ Database::Database(const Ice::ObjectAdapterPtr& registryAdapter,
_applicationSerial(0)
{
ServerEntrySeq entries;
- for(StringApplicationInfoDict::const_iterator p = _applications.begin(); p != _applications.end(); ++p)
+ for(StringApplicationInfoDict::iterator p = _applications.begin(); p != _applications.end(); ++p)
{
try
{
- load(ApplicationHelper(_communicator, p->second.descriptor), entries, p->second.uuid, p->second.revision);
+ //
+ // Create an application helper for the application
+ // without instantiating. The application might be invalid
+ // if we need to upgrade it.
+ //
+ ApplicationInfo info = p->second;
+
+ ApplicationHelper helper(_communicator, p->second.descriptor, false, false);
+ if(helper.upgrade(info.descriptor))
+ {
+ ++info.revision;
+ info.updateUser = "IceGrid Registry (database upgrade)";
+ info.updateTime = IceUtil::Time::now().toMilliSeconds();
+ p.set(info);
+ }
+
+ load(ApplicationHelper(_communicator, info.descriptor), entries, info.uuid, info.revision);
}
catch(const DeploymentException& ex)
{
- Ice::Warning warn(_traceLevels->logger);
- warn << "invalid application `" << p->first << "':\n" << ex.reason;
+ Ice::Error err(_traceLevels->logger);
+ err << "invalid application `" << p->first << "':\n" << ex.reason;
}
}