Thanks for your responses.
Actually we have two problems:

a) "database is locked" which in majority comes from sqlite3_step doing BEGIN IMMEDIATE which indeed is obtaining a write lock Basically we have just one connection per one datafile except one case when we have two connections for one datafile (one is read/write and the other is read only). Now I see that all "database is locked" problems comes from these shared datafile connections. So maybe this problem is actually somewhere inside our application.

We have WAL but I don't understand how WAL introduces opportunity for "database is locked" errors.

We have no busy timeout set because we use System.Data.SQlite library which has its own waiting mechanism (repeating the sqlite3_reset/sqlite3_step within 30 secons).

b) "database disk image is malformed", which is sometimes really caused by AV software. Our application is an email client, so the antivirus could theoretically found a virus signature inside datafile (but why would it just modify the file instead of moving to the quarantine as whole?).
We also have many reports with "database schema has changed" errors.


I have implemented locking_mode=exclusive (along with shared cache) and will check if this makes difference.

Best regards,
Jiri

On 24.11.2017 20:08:34, "Keith Medcalf" <kmedc...@dessus.com> wrote:


No.

The Windows Search Indexer or Windows Defender only processes files when they are "closed" (that is, the act of closing a file adds it to the queue of files to be processed). As long as they are "open" they are not enqueued for processing. There are a few exceptions, but they all require "application support" to behave in the non-default "do not fiddle-faddle with open files".

To do otherwise would be completely foolish (or more correctly, brain-dead).

Of course, if the software in question is a third-party thing such as from Slimeytech, McCrappy, or another brain dead vendor, then it is possible that it fiddle-faddles with files that are "in use" because it requires a certain minimum (but very low) wattage to realize what a really truly bad idea (ie, completely and utterly brain-dead) that is.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-
boun...@mailinglists.sqlite.org] On Behalf Of Nelson, Erik - 2
Sent: Friday, 24 November, 2017 10:20
To: SQLite mailing list
Subject: Re: [sqlite] Need SQLite datafiles to be locked on OS level
(Windows)

Jirí Matejka Sent on Friday, November 24, 2017 3:45 AM

but this does not prevent reading and modifying the file from other
processes while they are open by SQLite in our process.

Does antivirus or Windows randomly modify other applications' files?
It seems like no program could reliably execute under such
circumstances.


---------------------------------------------------------------------
-
This message, and any attachments, is for the intended recipient(s)
only, may contain information that is privileged, confidential and/or
proprietary and subject to important terms and conditions available
at http://www.bankofamerica.com/emaildisclaimer. If you are not the
intended recipient, please delete this message.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



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

Reply via email to