Hi,
I'm running two different processes, both access the same database at given
times, without synchronization. In order to handle a simultaneous access, I
was testing for the BUSY condition. However, one of the processes is
receiving a LOCKED status form SQLITE, resulting in a eternal deadlock.
According with this http://www.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked ,
that kind of error has nothing to do with concurrent process accessing the
same DB, but with a single process trying to do tow simultaneous and
contradictory actions, without finalizing the previous statement. The thing
is I am calling sqlite3_finalize between calls, so I'm really at a a loss
here. Any ideas?

Pseudocode:

Process 1:  read_db() Performs a select operation on table_1.
                 do_stuff() Doesnt touch the db.
                 write_db() Update operation on table_1
Process 2:
                 do_stuff();
                 if(certain condition has changed)
                       write_db(); Update operation on table_1 ---> This one
gets LOCKED

Best regards,
Martin Sigwald
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to