summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbcontacts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-13 21:33:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-13 21:33:15 +0000
commitc842fa175cdda0331567ea6f06e7084ceb51d260 (patch)
tree81457f2b09a80659cbd907e7ee74995a8bd0df85 /plugins/Dbx_mdb/src/dbcontacts.cpp
parent5952466c42cf02a659f5b110c77eca76a5476391 (diff)
well, everything works but events
git-svn-id: http://svn.miranda-ng.org/main/trunk@11850 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbcontacts.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp
index b02c4cb596..0a6e6859f1 100644
--- a/plugins/Dbx_mdb/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdb/src/dbcontacts.cpp
@@ -89,10 +89,12 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID)
MDB_val key = { sizeof(DWORD), &contactID };
- txn_lock trnlck(m_pMdbEnv);
- mdb_open(trnlck, "contacts", MDB_INTEGERKEY, &m_dbContacts);
- mdb_del(trnlck, m_dbContacts, &key, NULL);
- trnlck.commit();
+ for (;; Remap()) {
+ txn_lock trnlck(m_pMdbEnv);
+ mdb_del(trnlck, m_dbContacts, &key, NULL);
+ if (trnlck.commit())
+ break;
+ }
return 0;
}
@@ -110,10 +112,12 @@ STDMETHODIMP_(MCONTACT) CDbxMdb::AddContact()
MDB_val key = { sizeof(DWORD), &dwContactId };
MDB_val data = { sizeof(DBContact), &dbc };
- txn_lock trnlck(m_pMdbEnv);
- mdb_open(trnlck, "contacts", MDB_INTEGERKEY, &m_dbContacts);
- mdb_put(trnlck, m_dbContacts, &key, &data, 0);
- trnlck.commit();
+ for (;; Remap()) {
+ txn_lock trnlck(m_pMdbEnv);
+ mdb_put(trnlck, m_dbContacts, &key, &data, 0);
+ if (trnlck.commit())
+ break;
+ }
DBCachedContact *cc = m_cache->AddContactToCache(dwContactId);
cc->dwDriverData = 0;