replaced some pointers to mutables, some first thoughts about cursors

This commit is contained in:
Blue 2023-08-05 17:13:43 -03:00
parent 4975721a5c
commit 69bf1fcc3d
Signed by: blue
GPG key ID: 9B203B252A63EE38
9 changed files with 229 additions and 104 deletions

View file

@ -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));
}