mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-01 23:03:23 +01:00
re-added customizeSession() method from 1.4.x releases
This commit is contained in:
parent
64ed9bacf0
commit
8fd28947b9
@ -160,6 +160,12 @@ public:
|
||||
/// Returns true if session pool is active (not shut down).
|
||||
|
||||
protected:
|
||||
virtual void customizeSession(Session& session);
|
||||
/// Can be overridden by subclass to perform custom initialization
|
||||
/// of a newly created database session.
|
||||
///
|
||||
/// The default implementation does nothing.
|
||||
|
||||
typedef Poco::AutoPtr<PooledSessionHolder> PooledSessionHolderPtr;
|
||||
typedef Poco::AutoPtr<PooledSessionImpl> PooledSessionImplPtr;
|
||||
typedef std::list<PooledSessionHolderPtr> SessionList;
|
||||
|
@ -76,6 +76,7 @@ Session SessionPool::get()
|
||||
{
|
||||
Session newSession(SessionFactory::instance().create(_connector, _connectionString));
|
||||
applySettings(newSession.impl());
|
||||
customizeSession(newSession);
|
||||
|
||||
PooledSessionHolderPtr pHolder(new PooledSessionHolder(*this, newSession.impl()));
|
||||
_idleSessions.push_front(pHolder);
|
||||
@ -221,6 +222,11 @@ void SessionPool::applySettings(SessionImpl* pImpl)
|
||||
}
|
||||
|
||||
|
||||
void SessionPool::customizeSession(Session&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SessionPool::putBack(PooledSessionHolderPtr pHolder)
|
||||
{
|
||||
Poco::Mutex::ScopedLock lock(_mutex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user