Upscaledb.Database.Close C# (CSharp) Метод

Close() публичный Метод

Closes the Database
This method wraps the native ups_db_close function.
Before closing the Database, the cache is flushed to Disk.
public Close ( ) : void
Результат void
        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;
              }
        }

Usage Example

Пример #1
0
        private void Recovery()
        {
            Upscaledb.Environment env = new Upscaledb.Environment();
            Database db = new Database();
            env.Create("ntest.db", UpsConst.UPS_ENABLE_RECOVERY);
            db = env.CreateDatabase(1);

            byte[] k = new byte[5];
            byte[] r = new byte[5];
            db.Insert(k, r);
            db.Close();
            env.Close();
        }
All Usage Examples Of Upscaledb.Database::Close