Skip to content

database is locked: database is locked #1368

Answered by fnc12
guojikang asked this question in Q&A
Discussion options

You must be logged in to vote

hello. Try to solve this issue without sqlite_orm but with raw libsqlite3. The issue will persist cause one cannot write in different threads simultaneously. One can read from different threads simultaneously for sure for write can be performed only by one thread one time. So if you have a bunch of threads and you expect all of them to write to SQLite you need to either add mutex and check that performance is not reduced or make only one writing thread and pass all write requests to it.

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by guojikang
Comment options

You must be logged in to vote
1 reply
@fnc12
Comment options

Comment options

You must be logged in to vote
4 replies
@fnc12
Comment options

@fnc12
Comment options

@guojikang
Comment options

@fnc12
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants