Igor Tandetnik wrote:
Jef Driesen wrote:
I'm trying to execute a query from the callback function that is
registered with sqlite3_update_hook. But sqlite3_prepare_v2 always
returns SQLITE_MISUSE. Is it not allowed to execute queries from the
callback function?

I'm was trying to use the callback function as a notification
mechanism to update my GUI. Whenever I receive a notification on an
insert/delete, I want to retrieve the new/modified row and update the
displayed data.

Post yourself a message from inside the hook, update UI from that
message's handler. Most UI frameworks I know of have a concept of a
message or event queue to which you can post user-defined events.

I'm using gtk+ (actually the C++ bindings gtkmm) and tried to use g_idle_add from inside the hook. That approach seems to work in my first tests, but I was wondering if there is a possibility the idle callback is executed before sqlite is finished with the query?



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

Reply via email to