Is the PRAGMA value the retry interval, or the timeout where it 
aborts and reports a failure?


------------
Scott Doctor
scott at scottdoctor.com
------------------

On 5/2/2015 5:08 PM, Simon Slavin wrote:
> 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.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>

Reply via email to