You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running random inserting, deleting, selecting, updating in app that is running multiple times in pararrel, then sometimes I got "Database is Locked" error.
I set database timeout time to 30s
I run app in parallel with this code (12 means number of threads)
When I run app, after a while I see that some of commands exeutes in > 10s when most of the time rest operations take usually < 10ms to execute
140131560632768 delete - took 38.721323013305664 ms
140131560632768 update - took 4.200935363769531 ms
140131560632768 delete - took 4.871129989624023 ms
140131560632768 insert - took 11.445760726928711 ms
140131560632768 delete - took 5.630016326904297 ms
140131560632768 delete - took 4.244804382324219 ms
140131560632768 select - took 3.5469532012939453 ms
140131560632768 select - took 2.2268295288085938 ms
140131560632768 delete - took 16563.55047225952 ms
This is likely expected with sqlite, because same problems I got with python sqlite and rust diesel sqlite versions.
The problem is, that sometimes I got instant sqlite3 operational error(Database is locked message)
139769081631168 update - took 1.9054412841796875 ms
139769081631168 update - took 1.8732547760009766 ms
139769081631168 insert - took 1.6071796417236328 ms
139769081631168 insert - took 1.1374950408935547 ms
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF insert - took 4006.369113922119 ms
GOT EXCEPTION, trying again - retries number 2 <------ Here database shows, that first time executing command was unsuccessful(wait time before next check is 2s)
GOT EXCEPTION, trying again - retries number 1 <------ Another unsuccessful executing and again 2s sleep before next check
GOT EXCEPTION, no more to try
EXCEPTION database is locked OperationalError 140684239561152 delete - took 4006.1073303222656 ms <-------- 4s = 2s sleep + 2s sleep + 6ms executing - so there is missing 30s timeout
140684239561152 delete - took 4006.4618587493896 ms
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF delete - took 4006.4618587493896 ms
There is no 30s timeout here, but should be.
Almost same code I tried with python sqlite and rust diesel sqlite and I never had similar problems, so that is why I think that this is a problem with this library
I'm encountering the same issue, I have both the timeout parameter on the connect call and the PRAGMA busy_timeout set to 30 seconds, but when concurrent writes (from multiple threads with each their own connection) happen, .execute returns immediately with a Database is locked
Description
When running random inserting, deleting, selecting, updating in app that is running multiple times in pararrel, then sometimes I got "Database is Locked" error.
I set database timeout time to 30s
I run app in parallel with this code (12 means number of threads)
When I run app, after a while I see that some of commands exeutes in > 10s when most of the time rest operations take usually < 10ms to execute
This is likely expected with sqlite, because same problems I got with python sqlite and rust diesel sqlite versions.
The problem is, that sometimes I got instant sqlite3 operational error(Database is locked message)
There is no 30s timeout here, but should be.
Almost same code I tried with python sqlite and rust diesel sqlite and I never had similar problems, so that is why I think that this is a problem with this library
Code
Results
Details
The text was updated successfully, but these errors were encountered: