Upscaledb.Environment.Close C# (CSharp) Method

Close() public method

Closes the Environment
This method wraps the native ups_env_close function.
public Close ( ) : void
return void
        public void Close()
        {
            if (handle == IntPtr.Zero)
            return;
              lock (this) {
            foreach (Database db in databases)
              db.Close();
            databases.Clear();
            int st = NativeMethods.EnvClose(handle, 0);
            if (st != 0)
              throw new DatabaseException(st);
            handle = IntPtr.Zero;
              }
        }

Usage Example

Esempio n. 1
0
 private void OpenString()
 {
     Upscaledb.Environment env = new Upscaledb.Environment();
     try {
         env.Create("ntest.db");
         env.Close();
         env.Open("ntest.db");
         env.Close();
     }
     catch (DatabaseException e) {
         Assert.Fail("unexpected exception " + e);
     }
 }
All Usage Examples Of Upscaledb.Environment::Close