锁定 s3db 日志
几天来,我们在使用 sqlite 时遇到了一个奇怪的错误。我们在网络共享上使用 sqlite 数据库,并由多台计算机访问它。我们的客户报告说,数据库消失了。快速概览显示,数据库仍然存在,但没有计算机可以访问它。它还显示了一个 s3db-journal 文件,表明发生某些情况时有人正在访问数据库。奇怪的是 - s3db-journal 文件被文件系统锁定(我们无法复制/删除它)。重新启动所有应用程序后,锁定的文件就消失了。
这是怎么发生的?我们想以某种方式推断我们的客户是如何陷入这种情况的。我们知道其中一台计算机的网络布线已损坏。
感谢您的帮助。
Tobias
澄清一下:几台 = 最多 10 台计算机
a few days we had a strange error with sqlite. We use a sqlite database on a network share with several computers accessing it. Our client reported, that the database is gone. A quick overview showed, that the database was still there but no computer could access it. It also showed a s3db-journal file indicating that someone is/was accessing the db when something happened. The thing that is strange - the s3db-journal file was locked by the file system (we could not copy/delete it). After restarting all applications, the locked file disappeared as it should be.
How does this happen? We would like to deduct somehow how our client got into this situation. We know, that there was a corrupt network cabeling to one of the computers.
Thank you for your help.
Tobias
To clarify this: several = up to 10 computer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从“SQLite 的适当用途”页面:
这很可能是您正在使用的网络文件系统中的错误。不管怎样,SQLite 开发人员明确建议不要在网络文件系统上使用数据库。
From the "Appropriate uses for SQLite" page:
It very well might be a bug in the network filesystem you're using. Either way, the SQLite developers explicitly recommend against using databases on network filesystems.
问题已解决。数据库组件(zeos)抛出异常,我们尝试回滚。由于组件的设计方式,只有在启动事务时才允许这样做。如果不这样做,您将获得锁定的 s3db-journal 文件。
最后我们学到了两件事:当你没有启动事务时永远不要回滚,第二 - zeos 有一个函数 InTransaction 可以做到这一点。
The issue is resolved. The database-component (zeos) threw an exception and we tried a rollback. Due to the way the component was designed, this is only allowed when you started a transaction. If you don't you get the locked s3db-journal file.
In the end we learned 2 things: never rollback when you did not start a transaction, second - there is a function InTransaction from zeos for that.