summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbcontacts.cpp
diff options
context:
space:
mode:
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;