I established re-try logic to get this to work. :(
On Jun 5, 2009, at 7:08 PM, Rosemary Alles wrote:
>
> I have several (identical processors) accessing a sqlite3 database
> over NFS. I have a busy handler (see below) and use "begin exclusive"
>
> Periodically I get the following error from from sqlite3:
>
> Function:artd_sql_exec_stmt error in stmt:begin exclusive against
> database:/wise/fops/ref/artid/latents.db, error:[database is locked]
>
> I was under the impression that sqlite3 should return SQLITE_BUSY
> under these conditions?
>
> Here is my busy handler:
>
> PASSFAIL
> artid_sql_busy_handler(void* p_arg_one, int num_prior_calls) {
>
> // Adding a random value here greatly reduces locking?
> if (*((int *)p_arg_one) < ARTID_ZERO) {
> usleep((rand() % 50000) + 40000); // Change magic number after test
> }
> else {
> usleep(50000); // Change magic number after test
> }
>
> /*
> * Have sqlite3_exec immediately return SQLITE_BUSY or
> * sleep if handler has been called less than
> * threshold value. 50 secs?
> */
> return (num_prior_calls < ARTID_THOUSAND);
> }
>
>
> How would I know if my busy_handler (is even) being called? And how
> do I avoid the said error?
>
> Thanks,
> -rosemary.
>
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users