[11061] Bring 'autocommit' mode for MySQL back. This MySQL feature operates in so frustrating way so it is better to keep it ALWAYS ENABLED!!!

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2011-01-21 23:45:54 +02:00
parent f7a45e9e9a
commit fce48282ad
3 changed files with 7 additions and 10 deletions

View file

@ -283,10 +283,7 @@ bool Database::Execute(const char *sql)
return DirectExecute(sql);
// Simple sql statement
pTrans = new SqlTransaction;
pTrans->DelayExecute(sql);
m_threadBody->Delay(pTrans);
m_threadBody->Delay(new SqlStatement(sql));
}
return true;

View file

@ -152,12 +152,12 @@ bool MySQLConnection::Initialize(const char *infoString)
// autocommit is turned of during it.
// Setting it to on makes atomic updates work
// ---
// if you want atomic updates to work - USE TRANSACTIONS!!!
// no need to mess up with autocommit mode which might degrade server performance!
if (!mysql_autocommit(mMysql, 0))
DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 0");
// LEAVE 'AUTOCOMMIT' MODE ALWAYS ENABLED!!!
// W/O IT EVEN 'SELECT' QUERIES WOULD REQUIRE TO BE WRAPPED INTO 'START TRANSACTION'<>'COMMIT' CLAUSES!!!
if (!mysql_autocommit(mMysql, 1))
DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 1");
else
DETAIL_LOG("AUTOCOMMIT NOT SET TO 0");
DETAIL_LOG("AUTOCOMMIT NOT SET TO 1");
/*-------------------------------------*/
// set connection properties to UTF8 to properly handle locales for different

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11060"
#define REVISION_NR "11061"
#endif // __REVISION_NR_H__