You could achieve your result by defining a semaphore. A custom function in A would signal the semaphore and activate a thread in B when the DB changed. The thread in B would be waiting on the semaphore Both Unix and Windows implement semaphores in a similar manner.

A slightly higher level method would be to use a Unix message queue or a Windows named pipe to achieve the same effect. Process A writes a message, process B has a thread with a blocking read of the message.

In both cases there is no polling involved and the added overhead is minimal.

You don't need a package to implement these capabilities, just use the operating system APIs.

Vladimir Stokic wrote:
Thanks for the advice. I appreciate it. However, I am rather new at IPC, so I
would like to ask you for a bit more detailed explanation. Is there some
c/c++ library that would make sending and IPC package over to app B
possible? I do not want to do anything exotic here. A simple string sent over to app B
would be perfect. The simpler the solution, the more stable and quicker it
will be.
Once again, thanks for the help.

Vladimir Stokic


Scott Hess wrote:

Triggers won't help, either, because triggers run in the sqlite3
handle which, um, triggers.  So if app A makes a change, the trigger
runs in app A, but not in app B.

You could have a custom function which the trigger invokes to send an
IPC over to app B.

-scott


On 10/12/07, Vladimir Stokic <[EMAIL PROTECTED]> wrote:

Hi there,

I would like to know if there is any way to access some external
application
from within an SQLite trigger.

I have an application A that updates some rows in my SQLite database.
What I
want is to be able to detect that the change has occured from the
application B, without having to use the polling mechanism (i.e. to
periodically poll the database and check if the change has occured).
Basically, I need an alarm mechanism that will notify the application B
that
the change has occured on the particular table in the database.

I have read the documentation on http://www.sqlite.org/capi3ref.html and
I
have not found anything that would be useful in this particular
situation.
At first I thought it could be done using sqlite3_update_hook, but then I
learned that sqlite3_update_hook does not work that way.

If anyone could help me, I would be very grateful.

Thanks in advance,
Vladimir Stokic
--
View this message in context:
http://www.nabble.com/Accessing-external-applications-from-within-SQLite-triggers-tf4614175.html#a13177010
Sent from the SQLite mailing list archive at Nabble.com.


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



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







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

Reply via email to