SessionPool::name() (maybe this should go into session?)

SessionPool::shutdown() (hanging on destruction for static object - Timer?)
This commit is contained in:
Aleksandar Fabijanic
2008-10-17 18:48:27 +00:00
parent 5e28f8312e
commit 4e0cc97d6a
6 changed files with 103 additions and 35 deletions

View File

@@ -62,6 +62,7 @@ void SessionPoolContainer::add(SessionPool* pPool)
if (_sessionPools.find(pPool->name()) != _sessionPools.end())
throw InvalidAccessException("Session pool already exists: " + pPool->name());
pPool->duplicate();
_sessionPools.insert(SessionPoolMap::ValueType(pPool->name(), pPool));
}
@@ -72,7 +73,7 @@ Session SessionPoolContainer::add(const std::string& sessionKey,
int maxSessions,
int idleTime)
{
AutoPtr<SessionPool> pSP =
SessionPool* pSP =
new SessionPool(sessionKey, connectionString, minSessions, maxSessions, idleTime);
std::string name = pSP->name();
@@ -95,4 +96,12 @@ Session SessionPoolContainer::get(const std::string& name)
}
void SessionPoolContainer::shutdown()
{
SessionPoolMap::Iterator it = _sessionPools.begin();
SessionPoolMap::Iterator end = _sessionPools.end();
for (; it != end; ++it) it->second->shutdown();
}
} } // namespace Poco::Data