aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.h
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-01-13 20:07:09 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2011-01-13 20:07:09 +0100
commitcf9250c29f4e66f6a8fe6d14ace798a4252ce59b (patch)
tree00e9983260a4c20f7ffef1e2a2b05ba30d8b4772 /src/server/shared/Database/MySQLConnection.h
parent8d59953f9372c6876e0cd8078b44de6893082cbe (diff)
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.
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.h')
-rwxr-xr-xsrc/server/shared/Database/MySQLConnection.h4
1 files changed, 4 insertions, 0 deletions
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 <ace/Activation_Queue.h>
#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()
{