Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
刚开始获取AIR SQLite时发生错误3182磁盘I/O错误_Sqlite_Air - Fatal编程技术网

刚开始获取AIR SQLite时发生错误3182磁盘I/O错误

刚开始获取AIR SQLite时发生错误3182磁盘I/O错误,sqlite,air,Sqlite,Air,我们的软件有一个新的beta版本,有一些改动,但不在数据库层 我们刚刚开始在服务器日志中报告错误3128。似乎一旦它发生,只要应用程序打开,它就会发生。代码中最明显的部分是我们每秒通过SQLite记录数据的地方。仅本月一个月,我们就在服务器上产生了47k个错误 3128 Disk I/O error occurred. Indicates that an operation could not be completed because of a disk I/O error. Thi

我们的软件有一个新的beta版本,有一些改动,但不在数据库层

我们刚刚开始在服务器日志中报告错误3128。似乎一旦它发生,只要应用程序打开,它就会发生。代码中最明显的部分是我们每秒通过SQLite记录数据的地方。仅本月一个月,我们就在服务器上产生了47k个错误

3128     Disk I/O error occurred.   Indicates that an operation could not be completed because of a disk I/O error. This can happen if the runtime is attempting to delete a temporary file and another program (such as a virus protection application) is holding a lock on the file. This can also happen if the runtime is attempting to write data to a file and the data can't be written.  
我不知道是什么导致了这个错误。也许是反病毒程序?也许我们的应用程序正在变得混乱,并在彼此之上写入数据?我们正在使用异步连接

这引起了很多问题,我们都不知所措。这种情况在我们的旧版本中发生过,但一个月内可能发生100次,而不是47000次。无论哪种方式,我都希望它发生“0”次。

可能的解决方案:

概要:数据库可能没有问题,但在打开数据库后创建(或删除)临时文件时出现问题。AIR可能有权限访问数据库,但无权创建或删除目录中的文件

对我来说,一个有效的答案是使用
PRAGMA
语句将
日志模式
值设置为
删除
以外的值。您可以使用与发出查询语句相同的方式发出一个
PRAGMA
语句

不幸的是,如果应用程序在关闭日志模式时在事务的中间崩溃,那么数据库文件很可能会损坏。1。< /P>
1

解决方案是通过包装一个小包装器,确保数据库删除、更新和插入一次只发生一个。最重要的是,我们必须注意错误3128并重试。我认为这是因为我们运行了一个触发器,可以在插入数据后锁定数据库。

包装一个小包装器是什么意思?
PRAGMA journal_mode = OFF