mirror of
https://github.com/pocoproject/poco.git
synced 2025-12-26 18:27:29 +01:00
SessionPool::name() (maybe this should go into session?)
SessionPool::shutdown() (hanging on destruction for static object - Timer?)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user