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
This commit is contained in:
@@ -295,7 +295,9 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign
|
||||
// map->Remove(corpse, false);
|
||||
|
||||
// remove corpse from DB
|
||||
corpse->DeleteFromDB();
|
||||
SQLTransaction trans = WorldDatabase.BeginTransaction();
|
||||
corpse->DeleteFromDB(trans);
|
||||
WorldDatabase.CommitTransaction(trans);
|
||||
|
||||
// we don't want bones to save some cpu.. :)
|
||||
delete corpse;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user