moer 发表于 2024-4-11 16:30:41

【9.0.103】 "SQLite Error 5: 'database is locked'." 咋搞?


时间
下午4:28:14

日志类型
异常日志

用户名
cdd25f1b-0895-40bb-8d0d-41a757a5

异常调用堆栈
{
"SqliteErrorCode": 5,
"SqliteExtendedErrorCode": 5,
"IsTransient": false,
"SqlState": null,
"BatchCommand": null,
"ErrorCode": -2147467259,
"Message": "SQLite Error 5: 'database is locked'.",
"Data": {
    "$type": "System.Collections.ListDictionaryInternal, System.Private.CoreLib"
},
"InnerException": null,
"HelpLink": null,
"Source": "Microsoft.Data.Sqlite",
"HResult": -2147467259,
"StackTrace": "   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters)
   at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction()
   at SqliteWrapper.Sqlite.BeginTransaction(Nullable`1 isolationLevel, Boolean closeFk)
   at Forguncy.DataSourceBase.BeginTransaction(Nullable`1 isolationLevel, Boolean closeFk)
   at ForguncyDataAccess.DataAccess.BeginTransaction(String connectionStr, Nullable`1 dbType, Nullable`1 isolationLevel, Boolean closeFk)
   at Forguncy.Server2.Controllers.DataAccessUtility.DatabaseUpdater.c(ValueTuple`2 A_0)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Forguncy.Server2.Controllers.DataAccessUtility.DatabaseUpdater.e()
   at Forguncy.Server2.Controllers.DataAccessUtility.DatabaseUpdater.UpdateAsync()
   at Forguncy.Server2.Controllers.HomeController.<>c__DisplayClass142_0.<<AddTableDataApiAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Forguncy.Server2.Controllers.HomeController.a(Func`2 A_0)"
}

请求Id
55818152-45f7-460d-a848-9cf184caa6e0

Simon.Sun 发表于 2024-4-11 16:30:42

大佬好,看日志是数据库被锁了。由于是内建库是库级别的锁,所以这种错误会比较常见。
出现错误是具体是影响到哪里使用了呢?做了什么操作,有没有相关 demo,得进一步调查下,才能更好地解决您的问题。光看错误的话,不好判断。
页: [1]
查看完整版本: 【9.0.103】 "SQLite Error 5: 'database is locked'." 咋搞?