On 28 Nov 2018, at 3:26pm, Prajeesh Prakash <prajeeshprakash@elear.solutions> 
wrote:

> Then is that SQLITE_LOCKED error will happen because of a conflict within the 
> same database connection. Or in case of two connection two separate thread 
> trying to do operation?

Your software should never make two simultaneous API calls with the same 
connection.  It is the programmer's responsibility to make sure this never 
happens.  One of the ways you can avoid it happening is to use 
SQLITE_OPEN_FULLMUTEX , which is the default setting.

SQLITE_LOCKED happens when two different connections conflict.  But it is 
normal to set a timeout of a minute or two to allow each connection to back off 
and retry a few times before it gives up and reports SQLITE_LOCKED.  See

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

The timeout must be set separately for each connection.  You can also set 
timeout using a PRAGMA.

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

Reply via email to