mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 12:18:01 +01:00
workaround for GH #578
This commit is contained in:
@@ -24,7 +24,11 @@
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Mutex.h"
|
||||
#include "Poco/Data/DataException.h"
|
||||
#if defined(POCO_UNBUNDLED)
|
||||
#include <sqlite3.h>
|
||||
#else
|
||||
#include "sqlite3.h"
|
||||
#endif
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@@ -52,7 +56,7 @@ SessionImpl::SessionImpl(const std::string& fileName, std::size_t loginTimeout):
|
||||
{
|
||||
open();
|
||||
setConnectionTimeout(CONNECTION_TIMEOUT_DEFAULT);
|
||||
setProperty("handle", static_cast<void*>(_pDB));
|
||||
setProperty("handle", _pDB);
|
||||
addFeature("autoCommit",
|
||||
&SessionImpl::autoCommit,
|
||||
&SessionImpl::isAutoCommit);
|
||||
@@ -255,4 +259,14 @@ bool SessionImpl::isAutoCommit(const std::string&)
|
||||
}
|
||||
|
||||
|
||||
// NOTE: Utility::dbHandle() has been moved here from Utility.cpp
|
||||
// as a workaround for a failing AnyCast with Clang.
|
||||
// See <https://github.com/pocoproject/poco/issues/578>
|
||||
// for a discussion.
|
||||
sqlite3* Utility::dbHandle(const Session& session)
|
||||
{
|
||||
return AnyCast<sqlite3*>(session.getProperty("handle"));
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::SQLite
|
||||
|
||||
Reference in New Issue
Block a user