Bill Gatliff wrote:
The problem I'm seeing is that the GUI process is getting stale data
in its SELECT, unless it does a brief sleep between the sem_wait() and
the sqlite3_exec(). Specifically, the value returned is the value
immediately before the UPDATE. It's as if the trigger in the
data-generating process and the query in the GUI process are both
running before the new value is actually committed to the database
file and/or whatever caches are in between.
Is this expected behavior? Is there a better workaround than simply
sleeping after getting unblocked? Am I missing an entirely
different--- and better--- way of synchronizing my GUI to the database?
Bill,
As others have pointed out this is expected behavior. You should be able
to set a flag in the update trigger, and then check that flag in a
commit hook function (see
http://www.sqlite.org/capi3ref.html#sqlite3_commit_hook). If the flag is
set the commit hook can post to the semaphore and wakeup your GUI
process, and then clear the flag.
HTH
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------