错误代码门户
SQLiteSQLite错误代码

SQLITE_PROTOCOL

protocol

其他表示形式:15

代码 SQLITE_PROTOCOL · SQLite 报告的问题。

SQLITE_PROTOCOL 结果代码指示 SQLite 使用的文件锁定协议存在问题。 SQLITE_PROTOCOL 错误当前仅在使用 WAL 模式并尝试启动新事务时返回。当两个单独的数据库连接都尝试在 WAL 模式下同时启动事务时,可能会出现竞争条件。比赛的失败者在短暂的延迟后后退并再次尝试。如果同一个连接在几秒内多次失去锁定竞争,它最终将放弃并返回 SQLITE_PROTOCOL。 SQLITE_PROTOCOL 错误在实践中应该非常非常罕见,并且仅当有许多单独的进程都激烈竞争写入同一数据库时才出现。

Google Translate · 此内容为自动翻译。技术术语及适用条件请以英文原文为准。

The SQLITE_PROTOCOL result code indicates a problem with the file locking protocol used by SQLite. The SQLITE_PROTOCOL error is currently only returned when using WAL mode and attempting to start a new transaction. There is a race condition that can occur when two separate database connections both try to start a transaction at the same time in WAL mode. The loser of the race backs off and tries again, after a brief delay. If the same connection loses the locking race dozens of times over a span of multiple seconds, it will eventually give up and return SQLITE_PROTOCOL. The SQLITE_PROTOCOL error should appear in practice very, very rarely, and only when there are many separate processes all competing intensely to write to the same database.

故障排除与诊断链接

请先确认文档中的产品、版本及发生环境与当前情况一致。

此条目仅链接至官方代码参考文档。尚未验证单独的故障排除步骤。