“数据库文件被锁定”与 System.Data.SQLite
添加新事务后,我突然从 SQLite 收到以下错误:
数据库文件被锁定数据库 已锁定
有人看过吗?我添加了一个更新事务(在一些成功的选择/插入之后)。我找不到这个有什么不同...
I am suddenly getting the following errors from SQLite after adding a new transaction:
The database file is locked database
is locked
Has anyone seen this? I added an update transaction (following some successful selects/inserts). I can't find anything different about this one...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。通过查看 phxsoftware 网站上的这个 [真的很旧]线程,如果您在执行读取器和命令后不立即处理它们,似乎可能会出现锁定问题。
我通过确保不要将命令或读者放在周围并用 using 语句包围它们来解决我的问题。
(网络存档版本链接的)
I figured it out. From looking at this [really old] thread on the phxsoftware site, it seems like there can be locking problems if you don't immediately dispose of readers and commands after executing them.
I fixed my problem by making sure to not keep commands or readers around and surrounding them with using statements.
(Web archived version of the link)