Is there a known problem with SQLite giving the "database locked" error for the second query in one transaction when using Perl DBD :: SQLite? Scenario: Linux, Perl DBI, AutoCommit => 0, a routine with two blocks of code (using blocks to localize variable names). In the first block of code, the request descriptor is created with the prepare () command in the select statement, it is executed (), and the block is closed. The second code blocks another request descriptor, is created by preparing for the update statement, and often (30% of the time) SQLite / DBI gives a database lock error at this point. I think the error occurs during preparation (), and not at runtime ().
My job is to commit after the first request. (Calling the completion of the first request did not help). I prefer not to commit a few reasons related to elegance and efficiency. The source code worked fine for many years with Postgres as a database. I tried sqlite_use_immediate_transaction with no effect.
In all other situations, I found that SQLite works very well, so I suspect that this is an oversight in the DBD driver, not a problem with SQLite. Unfortunately, my current code is a bunch of scripts and modules, so I donβt have a short test case with one file.
sqlite perl dbi prepared-statement dbd
Tom
source share