I'm accessing a database from multiple threads, where each thread has a separate database connection.

When some specific event happens, I want the threads to evaluate the situation and act accordingly.

I have setup a temporary trigger which fires at the event and which in turn calls a user defined function updating a timestamp with the time of the event.

The threads compare this timestamp with a local timstamp storing the last synchronization, and if they mismatch they fetch data from the database and process it.

Now here's where it starts to seem a little tricky to me. It seems like the separate connections don't "see" the update made to the database from another thread if the fetching is done quickly after the update (as soon as the timestamps mismatch). I'm thinking that this maybe has to do with me using WAL mode, and that the update is not yet "processed enough" for the other threads to fetch the new data (so they still selects the old data), even though the trigger is set to fire "after update". Is this maybe the case? If so, any suggestions how to solve it?

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

Reply via email to