mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
PostgreSQL SessionHandle: don't call startTransaction in setAutoCommit
This commit is contained in:
@@ -277,11 +277,9 @@ void SessionHandle::setAutoCommit(bool aShouldAutoCommit)
|
|||||||
|
|
||||||
if (aShouldAutoCommit)
|
if (aShouldAutoCommit)
|
||||||
{
|
{
|
||||||
commit(); // end any in process transaction
|
Poco::FastMutex::ScopedLock mutexLocker(_sessionMutex);
|
||||||
}
|
if (_inTransaction)
|
||||||
else
|
commit(); // end any in process transaction
|
||||||
{
|
|
||||||
startTransaction(); // start a new transaction
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_isAutoCommit = aShouldAutoCommit;
|
_isAutoCommit = aShouldAutoCommit;
|
||||||
|
|||||||
@@ -1897,11 +1897,7 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
|
|||||||
|
|
||||||
bool autoCommit = _pSession->getFeature("autoCommit");
|
bool autoCommit = _pSession->getFeature("autoCommit");
|
||||||
|
|
||||||
// Next four lines inverted as autoCommit set to true is the normal mode
|
// autoCommit set to true is the normal mode
|
||||||
// autocommit set to false is the same as issuing a "begin" statement
|
|
||||||
_pSession->setFeature("autoCommit", false);
|
|
||||||
assertTrue (_pSession->isTransaction());
|
|
||||||
|
|
||||||
_pSession->setFeature("autoCommit", true);
|
_pSession->setFeature("autoCommit", true);
|
||||||
assertTrue (!_pSession->isTransaction());
|
assertTrue (!_pSession->isTransaction());
|
||||||
|
|
||||||
@@ -1995,11 +1991,11 @@ void SQLExecutor::transaction(const std::string& connect)
|
|||||||
|
|
||||||
bool autoCommit = _pSession->getFeature("autoCommit");
|
bool autoCommit = _pSession->getFeature("autoCommit");
|
||||||
|
|
||||||
_pSession->setFeature("autoCommit", false);
|
/* _pSession->setFeature("autoCommit", false);
|
||||||
assertTrue (_pSession->isTransaction());
|
assertTrue (_pSession->isTransaction());
|
||||||
_pSession->setFeature("autoCommit", true);
|
_pSession->setFeature("autoCommit", true);
|
||||||
assertTrue (!_pSession->isTransaction());
|
assertTrue (!_pSession->isTransaction());
|
||||||
|
*/
|
||||||
_pSession->setTransactionIsolation(Session::TRANSACTION_READ_COMMITTED);
|
_pSession->setTransactionIsolation(Session::TRANSACTION_READ_COMMITTED);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user