diff --git a/Data/SQLite/src/SessionImpl.cpp b/Data/SQLite/src/SessionImpl.cpp index 1146d403b..9d1583e9e 100644 --- a/Data/SQLite/src/SessionImpl.cpp +++ b/Data/SQLite/src/SessionImpl.cpp @@ -54,8 +54,8 @@ SessionImpl::SessionImpl(const std::string& fileName, std::size_t loginTimeout): open(); setConnectionTimeout(loginTimeout); setProperty("handle", _pDB); - addFeature("autoCommit", - &SessionImpl::autoCommit, + addFeature("autoCommit", + &SessionImpl::autoCommit, &SessionImpl::isAutoCommit); addProperty("connectionTimeout", &SessionImpl::setConnectionTimeout, &SessionImpl::getConnectionTimeout); } @@ -163,14 +163,15 @@ void SessionImpl::open(const std::string& connect) if (rc == SQLITE_OK) break; if (sw.elapsedSeconds() >= tout) { - close(); Utility::throwException(_pDB, rc); } - else Thread::sleep(10); + Thread::sleep(10); + close(); } - } + } catch (SQLiteException& ex) { + close(); throw ConnectionFailedException(ex.displayText()); } diff --git a/Data/SQLite/testsuite/src/SQLiteTest.cpp b/Data/SQLite/testsuite/src/SQLiteTest.cpp index 14a7012e7..2fecbd183 100644 --- a/Data/SQLite/testsuite/src/SQLiteTest.cpp +++ b/Data/SQLite/testsuite/src/SQLiteTest.cpp @@ -3368,7 +3368,7 @@ void SQLiteTest::testIllegalFilePath() { try { - Session tmp (Poco::Data::SQLite::Connector::KEY, "\\/some\\/illegal\\/path\\/dummy.db", 1); + Session tmp(Poco::Data::SQLite::Connector::KEY, "\\/some\\/illegal\\/path\\/dummy.db", 1); fail("must fail"); } catch (ConnectionFailedException&)