aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-08-21 03:19:25 +0200
committerMachiavelli <none@none>2010-08-21 03:19:25 +0200
commit994186f2672547761392c71ed15ded2a83e8c20d (patch)
tree53eec0c7571642b9490d2a664671cb216a730993 /src/server/game/Globals/ObjectMgr.cpp
parenta7498d2f560e24b2ae3b4f6cc46ea2223a41e16f (diff)
DB Layer:
- Make SQL Transactions actual objects used in code. (Thanks to Derex for the idea) * Uncommitted transactions will be automatically rolled back and cleaned up using ACE_Refcounted_Auto_Ptr, so no need to call Rollback() in the code. * Prevents recursive transactions and makes developers aware of transactions going on. * Gets rid of unneccesary overhead iterating over a concurrent map. - Some cleanups in affected code, including better usage of transaction control in AH / mail related code to prevent data loss. *** Experimental, use at own risk, recommended to backup your DBs. *** --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index e60fc55250b..247cbdeb6b1 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -9040,9 +9040,10 @@ void ObjectMgr::_AddOrUpdateGMTicket(GM_Ticket &ticket)
ss << ticket.closed << "', '";
ss << ticket.assignedToGM << "', '";
ss << comment << "');";
- CharacterDatabase.BeginTransaction();
- CharacterDatabase.Execute(ss.str().c_str());
- CharacterDatabase.CommitTransaction();
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ trans->Append(ss.str().c_str());
+ CharacterDatabase.CommitTransaction(trans);
}
void ObjectMgr::RemoveGMTicket(GM_Ticket *ticket, int64 source, bool permanently)