Make the hook queue a GUI update transaction and execute those transactions following the COMMIT. Discard the list of GUI update transactions on a ROLLBACK.

Jef Driesen wrote:
I was planning to use the sqlite3_update_hook function to notify my GUI
about changes. The idea was that every part of the GUI can update itself
when a database change is detected. But during testing, I encountered
some problems with this approach together with transactions.

When I group some SQL statements inside a transaction (for performance
or because they have to succeed or fail all together), the callback
function is executed for every statement:

BEGIN
statement 1 -> callback function called
statement 2 -> callback function called
COMMIT

But if the COMMIT is replaced with a ROLLBACK (for instance when an
error is detected), the callback functions are still called and the GUI
is updated with data that is not actually written to the database.

Any ideas on how to prevent this from happening?



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to