The "database is locked" message means that the transaction was unable to 
complete within the designated busy timeout and was therefore rolled back. 
Getting this message implies that you are running multiple processes. Depending 
on the journal mode, a writer process may block both readers and writers and 
vice versa (readers never block readers); or for WAL mode, a writer process 
only blocks other writers.

In any case, you need to set a sufficiently large timeout value OR establish a 
busy handler to deal with the situation. Try to keep transactions small; maybe 
you are beginning a transaction and never ending (commit/rollback) it?

What do you mean by "connection pooling"? Are you using the same connection 
from multiple threads?

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Wojciech Slabik (Voitec)
Gesendet: Freitag, 16. Februar 2018 10:17
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] "Database is locked" in diagnostic tools C#

Hi everyone,

I have managed  to successfully replace SQLCE with System.Data.SQLite in a 
mid-size application. Everything works fine but now that I started optimizing 
the old code and replaced own connection pooling with SQLite connection pooling 
I am getting an occasional Program Output "Database is locked" from the C++ dll 
being displayed in the VS Diagnostic Tools. This is not throwing an exception 
in C# though, so I am wondering if this just means that the transaction has 
slept and was re-executed successfully? I tried to replicate this issue in a 
small app but transaction just waits 30 seconds (default busy timeout?) and 
throws an exception, there is nothing showing up in the Diagnostic Tools.

Thanks in advance,
Wojciech

[Micromine PL]<http://www.micromine.com>

Micromine PL
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to