Getting Uncommitted Transactions Sqlite With System.Data.Sqlite

500 views Asked by At

I am trying to get a count of uncommitted records in a SQLite database using the System.Data.Sqlite library. My research thus far has pointed towards using the PRAGMA read_committed, but I always get a count of 0 until records are committed. Any tips?

using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + this.Path))
            {
                conn.Open();
                using (SQLiteCommand cmd = new SQLiteCommand(conn))
                {
                    cmd.CommandText = "PRAGMA read_uncommitted = true;";
                    cmd.ExecuteNonQuery();

                    cmd.CommandText = "SELECT Count() FROM Tiles WHERE TileLayerId = " + tileLayerId;
                    return Convert.ToInt32(cmd.ExecuteScalar());
                }
            }
0

There are 0 answers