On 3 May 2015, at 12:55am, J Decker <d3ck0r at gmail.com> wrote:

> Yes, it really requires only a little additional work on application side.
> The native open will open it in read/write share allow, and handle
> interlocking.
> 
> if you get a result of SQLITE_BUSY you need to retry the operation after a
> short time.

Just to update J a little, you no longer need to handle the retry in your own 
code.  SQLite has its own exponential-backoff-and-retry feature.  You set it up 
using either C code or a PRAGMA, which have identical result:

<https://www.sqlite.org/c3ref/busy_timeout.html>

<https://www.sqlite.org/pragma.html#pragma_busy_timeout>

Do this with your connection handle after you open the database.  Set it to a 
couple of minutes, or however long you want your program to keep retrying 
before failing and reporting an error to the user.

Simon.

Reply via email to