| 37 | } |
| 38 | |
| 39 | LMDBCursor* LMDB::NewCursor() { |
| 40 | MDB_txn* mdb_txn; |
| 41 | MDB_cursor* mdb_cursor; |
| 42 | MDB_CHECK(mdb_txn_begin(mdb_env_, NULL, MDB_RDONLY, &mdb_txn)); |
| 43 | MDB_CHECK(mdb_dbi_open(mdb_txn, NULL, 0, &mdb_dbi_)); |
| 44 | MDB_CHECK(mdb_cursor_open(mdb_txn, mdb_dbi_, &mdb_cursor)); |
| 45 | return new LMDBCursor(mdb_txn, mdb_cursor); |
| 46 | } |
| 47 | |
| 48 | LMDBTransaction* LMDB::NewTransaction() { |
| 49 | return new LMDBTransaction(mdb_env_); |