mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-31 14:39:53 +01:00
getConnectionTimeout of SQLite DB wrapper returns wrong value (in milliseconds, should be in seconds) #1729
This commit is contained in:
parent
8c336637f9
commit
94e9f2eec2
@ -73,9 +73,11 @@ public:
|
|||||||
|
|
||||||
void setConnectionTimeout(std::size_t timeout);
|
void setConnectionTimeout(std::size_t timeout);
|
||||||
/// Sets the session connection timeout value.
|
/// Sets the session connection timeout value.
|
||||||
|
/// Timeout value is in seconds.
|
||||||
|
|
||||||
std::size_t getConnectionTimeout();
|
std::size_t getConnectionTimeout();
|
||||||
/// Returns the session connection timeout value.
|
/// Returns the session connection timeout value.
|
||||||
|
/// Timeout value is in seconds.
|
||||||
|
|
||||||
void begin();
|
void begin();
|
||||||
/// Starts a transaction.
|
/// Starts a transaction.
|
||||||
@ -156,7 +158,7 @@ inline const std::string& SessionImpl::connectorName() const
|
|||||||
|
|
||||||
inline std::size_t SessionImpl::getConnectionTimeout()
|
inline std::size_t SessionImpl::getConnectionTimeout()
|
||||||
{
|
{
|
||||||
return static_cast<std::size_t>(_timeout);
|
return static_cast<std::size_t>(_timeout/1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ SessionImpl::SessionImpl(const std::string& fileName, std::size_t loginTimeout):
|
|||||||
_isTransaction(false)
|
_isTransaction(false)
|
||||||
{
|
{
|
||||||
open();
|
open();
|
||||||
setConnectionTimeout(CONNECTION_TIMEOUT_DEFAULT);
|
setConnectionTimeout(loginTimeout);
|
||||||
setProperty("handle", _pDB);
|
setProperty("handle", _pDB);
|
||||||
addFeature("autoCommit",
|
addFeature("autoCommit",
|
||||||
&SessionImpl::autoCommit,
|
&SessionImpl::autoCommit,
|
||||||
|
@ -253,6 +253,9 @@ SQLiteTest::~SQLiteTest()
|
|||||||
void SQLiteTest::testBinding()
|
void SQLiteTest::testBinding()
|
||||||
{
|
{
|
||||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||||
|
assert (tmp.getConnectionTimeout() == Session::LOGIN_TIMEOUT_DEFAULT);
|
||||||
|
tmp.setConnectionTimeout(5);
|
||||||
|
assert (tmp.getConnectionTimeout() == 5);
|
||||||
assert (tmp.isConnected());
|
assert (tmp.isConnected());
|
||||||
std::string tableName("Simpsons");
|
std::string tableName("Simpsons");
|
||||||
std::string lastName("Simpson");
|
std::string lastName("Simpson");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user