sqlite3_exec() private method

private sqlite3_exec ( IntPtr db, byte strSql, IntPtr pvCallback, IntPtr pvParam, IntPtr &errMsg, int &len ) : int
db IntPtr
strSql byte
pvCallback IntPtr
pvParam IntPtr
errMsg IntPtr
len int
return int
Ejemplo n.º 1
0
        internal static void ResetConnection(SqliteConnectionHandle db)
        {
            lock (_lock)
            {
                IntPtr stmt = IntPtr.Zero;

                do
                {
                    stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt);
                    if (stmt != IntPtr.Zero)
                    {
#if !SQLITE_STANDARD
                        UnsafeNativeMethods.sqlite3_reset_interop(stmt);
#else
                        UnsafeNativeMethods.sqlite3_reset(stmt);
#endif
                    }
                } while (stmt != IntPtr.Zero);

                // Not overly concerned with the return value from a rollback.
                UnsafeNativeMethods.sqlite3_exec(db, ToUTF8("ROLLBACK"), IntPtr.Zero, IntPtr.Zero, out stmt);
                // but free the error message if any!
                if (stmt != IntPtr.Zero)
                {
                    UnsafeNativeMethods.sqlite3_free(stmt);
                }
            }
        }
Ejemplo n.º 2
0
        internal static void ResetConnection(SqliteConnectionHandle db)
        {
            lock (_lock)
            {
                SqliteStatementHandle stmt = null;
                do
                {
                    stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt);
                    if (stmt != null)
                    {
                        UnsafeNativeMethods.sqlite3_reset(stmt);
                    }
                } while (stmt != null);

                // Not overly concerned with the return value from a rollback.
                string msg = null;
                UnsafeNativeMethods.sqlite3_exec(db, "ROLLBACK", out msg);
            }
        }