From cf9250c29f4e66f6a8fe6d14ace798a4252ce59b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 13 Jan 2011 20:07:09 +0100 Subject: Core/DBLayer: - Implement DatabaseWorkerPool::DirectCommitTransaction for synchronous transaction execution (as opposed to asynchronous/enqueued). - Add MySQL errno 1213 "Deadlock found when trying to get lock; try restarting transaction" handler. If 1213 is called the core will retry to directly execute the transaction a maximum of 5 times. --- src/server/shared/Database/MySQLConnection.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/server/shared/Database/MySQLConnection.h') diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h index f96284de5f8..9cc57000171 100755 --- a/src/server/shared/Database/MySQLConnection.h +++ b/src/server/shared/Database/MySQLConnection.h @@ -18,6 +18,7 @@ #include #include "DatabaseWorkerPool.h" +#include "Transaction.h" #include "Util.h" #ifndef _MYSQLCONNECTION_H @@ -91,10 +92,13 @@ class MySQLConnection void BeginTransaction(); void RollbackTransaction(); void CommitTransaction(); + bool ExecuteTransaction(SQLTransaction& transaction); operator bool () const { return m_Mysql != NULL; } void Ping() { mysql_ping(m_Mysql); } + uint32 GetLastError() { return mysql_errno(m_Mysql); } + protected: bool LockIfReady() { -- cgit v1.2.3