rawberg / connect-sqlite3

SQLite3 session store for connect and express.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Code SQLITE_LOCKED (6): Database Is Locked

gottsohn opened this issue · comments

This error occurs infrequently when using express-session

The problem is probably that you are using multiple workers? I'm seeing the same, only when using multiple workers.

The solution would be to set the session db to use WAL mode. This does change it to be 3 files instead of one.

To do this manually, do this from the command line:

$ sqlite3 sessions.db 'pragma journal_mode=wal;'
wal

You can do this while your app is running. From then on, it should be fine.