bildwelt
E2E FORUM
E2E Bridge E2E Commerce

Reply To: SQLite "Database is locked" on multi thread insert statement

E2E Forum Modeling & Development SQLite "Database is locked" on multi thread insert statement Reply To: SQLite "Database is locked" on multi thread insert statement

#3305

Jakub
Moderator

Hi,
first of all “Create Thread” is deprecated and shouldn’t be used.
Regarding SQLite: it’s designed to handle concurrent reads well but does not handle concurrent writes at all. As soon as one thread acquires a write lock, all others are blocked (SQLite has only file-level lock) until this thread releases the lock (usually by committing its transaction). You could try committing the transaction after each insert but that would a) have a really bad performance, b) interfere with the internal transaction handling, so I recommend against it.


Regards,
Jakub