Closed erdnussflips closed 6 years ago
Ah, it's to do with cached prepared statements. You can't prepare a statement, update schema, and then re-use it. :D
We fixed this for PDO with https://github.com/silverstripe/silverstripe-framework/pull/4288.
Please copy the same solution for this module and it'll just work. :P
Hm, once I switched my brain on, I noticed you were using PDO already (sqlite3 pdo).
Perhaps some digging is still needed? Maybe the existing solution just needs tweaking a bit.
That PR above took me a year to fix... >_>
The sqlite docs says:
If a prepared statement is generated from sqlite3_prepare_v2() then the statement is automatically re-prepared if the schema changes, up to SQLITE_MAX_SCHEMA_RETRY times (default: 50). The sqlite3_step() interface will only return SQLITE_SCHEMA back to the application if the failure persists after these many retries.
Ok, so potentially this is a different problem causing this failure?
Could you be running multiple dev/builds in separate threads?
Maybe we should run dev/build in a transaction with an exclusive lock?
2 years and no update, not sure this is still a problem.
feel free to reopen if it is
PHP: 5.6.23 Silverstripe version: 3.4.0 pdo-sqlite version: 3.8.10.2 silverstripe-sqlite3 version: 1.4.x-dev Connector type: SQLite3PDODatabase
When I do a dev/build I get the following error:
With silverstripe version 4.0.0-alpha1 and silverstripe-sqlite3 version 2.0.0 this error doesn't occur (PHP 7).
I debugged it and it seems to be occur, when SQLite3SchemaManager->tableList() is called a second one. Maybe a timing problem? (https://www.sqlite.org/rescode.html#schema)
PS: It's a clear silverstripe installation
Trace: