开发者

Getting Uncommitted Transactions Sqlite With System.Data.Sqlite

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;";
                    cm开发者_运维知识库d.ExecuteNonQuery();

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜