Hi Everyone,
I'm trying to hunt down an awkard bug in a multi-threaded application so
I was interested in people's opinions on whether the following is a
likely problem scenario.

-       the application is distributed, so while it is running it
re-syncronises it's state with the server by recieving a copy of the
server's database. At this point it detaches it's current mounted
database and mounts the new file. It has a local database with local
settings which is the applications 'main' database connection with the
copy of the server's database mounted from that via the attach command.

What I think could be happening is this....

1) Thread A prepares a bit of update SQL on the mounted database.  (it
is using the execute API call but this just does a prepare and an
execute)

2) Thread B detaches the mounted database

3) Thread B atttaches a new mounted database

4) Thread A executes the previously prepared SQL. Seg fault. Oops

steps 3 and 4 maybe the other way round.

So what is the general opinion on this ? (apart from the obvious of it
not being a bright idea trying to detached and re-attach databases in a
multi-threaded environment !!)
-       would using the online backup / restore API be better worse or
indifferent ?

many thanks 
Owen





_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to