mdb_dbi_close function

void mdb_dbi_close(
  1. Pointer<MDB_env> env,
  2. int dbi
)

@brief Close a database handle. Normally unnecessary. Use with care:

This call is not mutex protected. Handles should only be closed by a single thread, and only if no other threads are going to reference the database handle or one of its cursors any further. Do not close a handle if an existing transaction has modified its database. Doing so can cause misbehavior from database corruption to errors like MDB_BAD_VALSIZE (since the DB name is gone).

Closing a database handle is not necessary, but lets #mdb_dbi_open() reuse the handle value. Usually it's better to set a bigger #mdb_env_set_maxdbs(), unless that value would be large.

@paramin env An environment handle returned by #mdb_env_create() @paramin dbi A database handle returned by #mdb_dbi_open()

Implementation

@ffi.FfiNative<ffi.Void Function(ffi.Pointer<MDB_env>, MDB_dbi)>(
    'mdb_dbi_close')
external void mdb_dbi_close(
  ffi.Pointer<MDB_env> env,
  int dbi,
);