Hi Richard
I have enabled error  logging as suggested. Is there a way to test this 
logging. For e.g. I just corrupted the database by modifying the sqlite db 
using vi and then got the following message:-

"file is encrypted or is not a database"
After this error message my process dies(we terminate the process), and I don't 
see any logs from my callback.  Is this callback called before the sqlite3_xxx 
calls returns , if yes then why I don't see any error messages from the 
callback ?

-Mayank


-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Richard Hipp
Sent: Tuesday, July 08, 2014 1:05 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Sometimes when my process restarts, it returns error 
"database is locked"

On Tue, Jul 8, 2014 at 3:58 PM, Mayank Kumar (mayankum) <mayan...@cisco.com>
wrote:

> Hi All
>
> We have a process with a single sqlite db and a single connection to 
> the database from a thread. From time to time our processs restarts 
> and reopens the database or tries to create the database if it doesn't exists.
>  Sometimes when the process restarts, we get the error "database is locked"
> although the way the process is restarted is the following:-
>
> -we always starts the process as a child by doing a vfork and exec -if 
> we receive a sigchld, we waitpid and finally restarts the process in 
> same way
>

I don't think this is possible.  I think something else must be going on.

Have you enabled logging?  See http://www.sqlite.org/errlog.html for details.  
The error log might give additional clues.



>
> Could this scenario ever lead to database locked scenario, should we 
> build a retry mechanism when we get this error or this shouldn't occur 
> if we know the older process has died.
>
> Any suggestions?
>
> -Mayank
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to