"Vladimir Volkov"
<[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> I have the following problem: I have some  processes that access the
> same db file. When one of them would change some data inside the db
> it must notify all other processes about change AND send them changed
> data (or it's unique description).
>
> But I didn't find any method to perform this using db triggers or
> callbacks.

Correct. SQLite is not an interprocess communication mechanism. You will 
have to come up with your own scheme, outside SQLite.

> On some certain reasons I am not allowed to write wrapper
> that will send notifications using IPC.

You mean, you need to perform IPC but you are not allowed to write code 
that performs IPC? That's quite a corner you are painted into.

> I would like db to perform
> this task.

Then I guess SQLite is not suitable for your problem (though I can't 
think of any other DBMS that can do that, either).

> As for triggers and callbacks (hooks): they are fired before the data
> is stored to the db (file), so that I coudn't even read changed data
> back inside hook.

As long as you use the same connection to access the database as the one 
that caused the trigger or callback to fire in the first place, you 
should see the new data. It doesn't matter that the data has not been 
written to the physical file yet.

If you are trying to use a different connection, you would only see 
changes once the first connection committed its transaction - so don't 
do that.

> sqlite_update_hook() returnes rowID, but I didn't
> find any API to use this value...

You just run a statement along the lines of

select * from dbName.tableName where rowid=?

You need to run this statement on the same connection the hook is 
installed on.

Igor Tandetnik 



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

Reply via email to