On 27 Nov 2012, at 5:05am, Tristan Van Berkom <trista...@openismus.com> wrote:

> Now what I'd like to do additionally is notify clients
> of changes without the IPC, relying only on SQLite's
> presumably lightweight IPC change notifications
> (notifications which, I'm now discovering don't
> exist...)

Right.

> If SQLite could at least notify us which row was
> added/removed/changed, then we could potentially
> propagate that change to the client directly
> at least without serializing/deserializing the
> contact data and pushing the whole thing through
> the IPC.

If it helps, the only way I've ever done this successfully is to add a log 
table to the database file and instead of calling the SQLite API, call my own 
API which adds an entry to the log table and then calls the normal SQLite API.  
To detect whether anything has changed you do

SELECT id FROM changeLog ORDER BY id DESC LIMIT 1

and see if it's the same as it was last time.  If it has you can read the new 
entries to see what was done.  Of course, if you are accessing SQLite using a 
general database driver and cannot change your code you can't do this.

The implementation I was doing this in had no access to sqlite3_update_hook() 
so I never considered it and didn't know about the thread/process problem.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to