/// <summary> /// Closes the Database /// </summary> /// <remarks> /// This method wraps the native ups_db_close function. /// <br /> /// Before closing the Database, the cache is flushed to Disk. /// </remarks> public void Close() { lock (this) { if (handle == IntPtr.Zero) { return; } foreach (Cursor c in cursors) { c.Close(); } cursors.Clear(); int st = NativeMethods.Close(handle, 0); if (st != 0) { throw new DatabaseException(st); } handle = IntPtr.Zero; } }