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:
1 parent
a7498d2f56
commit
994186f267
49 files changed
+861
-774
No files matched your search
@@ -644,10 +644,10 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
<< uint32(GetGoAnimProgress()) << ", "
|
||||
<< uint32(GetGoState()) << ")";
|
||||
|
||||
WorldDatabase.BeginTransaction();
|
||||
WorldDatabase.PExecute("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
WorldDatabase.PExecute(ss.str().c_str());
|
||||
WorldDatabase.CommitTransaction();
|
||||
SQLTransaction trans = WorldDatabase.BeginTransaction();
|
||||
trans->PAppend("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
trans->Append(ss.str().c_str());
|
||||
WorldDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
|
||||
Reference in new issue
Block a user