mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
PostgreSQL SessionHandle: don't call startTransaction in setAutoCommit
This commit is contained in:
parent
743da564eb
commit
6eec8adfcb
@ -277,11 +277,9 @@ void SessionHandle::setAutoCommit(bool aShouldAutoCommit)
|
||||
|
||||
if (aShouldAutoCommit)
|
||||
{
|
||||
commit(); // end any in process transaction
|
||||
}
|
||||
else
|
||||
{
|
||||
startTransaction(); // start a new transaction
|
||||
Poco::FastMutex::ScopedLock mutexLocker(_sessionMutex);
|
||||
if (_inTransaction)
|
||||
commit(); // end any in process transaction
|
||||
}
|
||||
|
||||
_isAutoCommit = aShouldAutoCommit;
|
||||
|
@ -1897,11 +1897,7 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
|
||||
|
||||
bool autoCommit = _pSession->getFeature("autoCommit");
|
||||
|
||||
// Next four lines inverted as 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());
|
||||
|
||||
// autoCommit set to true is the normal mode
|
||||
_pSession->setFeature("autoCommit", true);
|
||||
assertTrue (!_pSession->isTransaction());
|
||||
|
||||
@ -1995,11 +1991,11 @@ void SQLExecutor::transaction(const std::string& connect)
|
||||
|
||||
bool autoCommit = _pSession->getFeature("autoCommit");
|
||||
|
||||
_pSession->setFeature("autoCommit", false);
|
||||
/* _pSession->setFeature("autoCommit", false);
|
||||
assertTrue (_pSession->isTransaction());
|
||||
_pSession->setFeature("autoCommit", true);
|
||||
assertTrue (!_pSession->isTransaction());
|
||||
|
||||
*/
|
||||
_pSession->setTransactionIsolation(Session::TRANSACTION_READ_COMMITTED);
|
||||
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user