internal static void CloseConnectionV2(SQLiteConnectionHandle hdl, IntPtr db) { if ((hdl == null) || (db == IntPtr.Zero)) { return; } try { // do nothing. } finally /* NOTE: Thread.Abort() protection. */ { #if PLATFORM_COMPACTFRAMEWORK lock (hdl.syncRoot) #else lock (hdl) #endif { #if !SQLITE_STANDARD SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_close_interop(db); #else ResetConnection(hdl, db, false); SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_close_v2(db); #endif if (n != SQLiteErrorCode.Ok) { throw new SQLiteException(n, GetLastError(hdl, db)); } } } }
internal static void CloseConnection(SQLiteConnectionHandle db) { lock (_lock) { int errorCode = UnsafeNativeMethods.sqlite3_close_interop((IntPtr)db); if (errorCode > 0) { throw new SQLiteException(errorCode, SQLiteLastError(db)); } } }
internal override void Close() { if (_sql != IntPtr.Zero) { int n = UnsafeNativeMethods.sqlite3_close_interop(_sql); if (n > 0) { throw new SQLiteException(n, SQLiteLastError()); } SQLiteFunction.UnbindFunctions(this, _functionsArray); } _sql = IntPtr.Zero; }
internal static void CloseConnection(SQLiteConnectionHandle db) { lock (_lock) { #if !SQLITE_STANDARD int n = UnsafeNativeMethods.sqlite3_close_interop(db); #else ResetConnection(db); int n = UnsafeNativeMethods.sqlite3_close(db); #endif if (n > 0) { throw new SQLiteException(n, SQLiteLastError(db)); } } }
internal static void CloseConnection(SQLiteConnectionHandle hdl, IntPtr db) { if ((hdl == null) || (db == IntPtr.Zero)) { return; } lock (hdl) { #if !SQLITE_STANDARD int n = UnsafeNativeMethods.sqlite3_close_interop(db); #else ResetConnection(hdl, db); int n = UnsafeNativeMethods.sqlite3_close(db); #endif if (n > 0) { throw new SQLiteException(n, GetLastError(hdl, db)); } } }