Open doublenb opened 5 years ago
Is upgrading SQLite possible? Not having upsert for session is a huge drawback (concurrency issues will be there).
Using SQLite as session backend already implies concurrency issues :D
@samdark - I'm investigating if I can upgrade it, just thought I would raise the issue.
I see there is some consideration in the QueryBuilder for what the SQLite version is (e.g. in batchInsert()), but not in upsert(), so just thought the devs would like to know.
@rob006 - we have in the past seen some session locking problems using PHP default sessions, which is what the SQLite session DB helped with. Along with http2, it improved loading times on pages where there are multiple ajax calls with long running database queries.
@doublenb consider Redis. It's much better in this regard.
Just to remember that my project santilin/yii2-sqlite3-full-support
adds some functionality to sqlite3. Although I have not yet implemented upsert(), I could try to implement it if required.
What steps will reproduce the problem?
Run these commands:
Add the following to
components
inconfig/web.php
As far as I can tell, the error page also uses sessions, and causes the page to break without showing a Yii error message (it throws a
yii\web\HeadersAlreadySentException
as seen in nginx error logs). To help with this (just for illustration of this bug), at the top ofweb/index.php
, add this below the opening<?php
tagWhat is the expected result?
The home page of the basic app to load successfully
What do you get instead?
A
yii\db\Exception
error page showing the following:Additional info
Upon some investigation, the error seems to come from this commit which added upsert support for
yii\db\QueryBuilder
.From what I can gather, the "WITH" command (or Common Table Expressions) was only added to sqlite in version
3.8.3
as detailed in https://www.sqlite.org/changes.html