replaced some pointers to mutables, some first thoughts about cursors
This commit is contained in:
parent
4975721a5c
commit
69bf1fcc3d
9 changed files with 229 additions and 104 deletions
src
11
src/base.cpp
11
src/base.cpp
|
@ -67,13 +67,12 @@ LMDBAL::Base::~Base() {
|
|||
*/
|
||||
void LMDBAL::Base::close() {
|
||||
if (opened) {
|
||||
for (LMDBAL::TransactionID id : *transactions)
|
||||
for (const LMDBAL::TransactionID id : *transactions)
|
||||
abortTransaction(id, emptyName);
|
||||
|
||||
for (const std::pair<const std::string, iStorage*>& pair : storages) {
|
||||
iStorage* storage = pair.second;
|
||||
mdb_dbi_close(environment, storage->dbi);
|
||||
}
|
||||
for (const std::pair<const std::string, iStorage*>& pair : storages)
|
||||
pair.second->close();
|
||||
|
||||
mdb_env_close(environment);
|
||||
transactions->clear();
|
||||
opened = false;
|
||||
|
@ -101,7 +100,7 @@ void LMDBAL::Base::open() {
|
|||
TransactionID txn = beginPrivateTransaction(emptyName);
|
||||
for (const std::pair<const std::string, iStorage*>& pair : storages) {
|
||||
iStorage* storage = pair.second;
|
||||
int rc = storage->createStorage(txn);
|
||||
int rc = storage->open(txn);
|
||||
if (rc)
|
||||
throw Unknown(name, mdb_strerror(rc));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue