SQLite错误(10):因锁定/共享冲突而延迟25ms [英] SQLite error (10): delayed 25ms for lock/sharing conflict
问题描述
我的 C#/SQLite应用可以正常运行,但有时会输出此错误:>
My C#/SQLite app works fine but outputs this error once in a while:
SQLite error (10): delayed 25ms for lock/sharing conflict
根据此线程上的建议,我已更新为最新的SQLite,但仍然会发生.
该如何解决?
As suggested on this thread, I updated to the latest SQLite, but it still happens.
How to fix this?
SQLite版本:sqlite-netFx40-static-binary-Win32-2010-1.0.84.0.zip
在
SQLite version: sqlite-netFx40-static-binary-Win32-2010-1.0.84.0.zip
at the Precompiled Statically-Linked Binaries for 32-bit Windows (.NET Framework 4.0)
paragraph at http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
Visual C#2010 Express
Visual C# 2010 Express
推荐答案
此原始代码中的
using (var command = new SQLiteCommand(GetSQLiteConnection()))
{
try
{
command.CommandText =
"DELETE FROM folders WHERE path='" + path + "'";
command.ExecuteNonQuery();
}
catch (SQLiteException e)
{
SparkleLogger.LogInfo("CmisDatabase", e.Message);
}
}
更改为此即可解决问题(仅前两行有所不同):
Changing to this solved the problem (only the first two lines differ):
var connection = GetSQLiteConnection();
using (var command = new SQLiteCommand(connection))
{
try
{
command.CommandText =
"DELETE FROM folders WHERE path='" + path + "'";
command.ExecuteNonQuery();
}
catch (SQLiteException e)
{
SparkleLogger.LogInfo("CmisDatabase", e.Message);
}
}
这篇关于SQLite错误(10):因锁定/共享冲突而延迟25ms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!