Subject Re: firebird events question
Author russellbelding
I think I understand your idea. For each connection to the DB file I
assign an application a SESSION_ID. Each client application knows its
SESSION_ID. Each table of interest to me should have a SESSION_ID
column. Each change to the DB changes the session ID_column to the
SESSION _ID of the client making the change.

Each trigger I use issues two POST_EVENTs
POST_EVENT cast(new.SESSION_ID as varchar(16))
POST_EVENT 'EVENT_NAME'

Each form registers to listen for EVENT_NAME and SESSION_ID.asString.

As I only want to act on events I did not cause, whenever I get a
SESSION_ID event along with the 'EVENT_NAME' event, I ignore
the 'EVENT_NAME' event.

This would work for me after I addedd a new column to each table.

Thanks

Russell

--- In firebird-support@yahoogroups.com, "Photios Loupis (4T)"
<loupisp@a...> wrote:
> I have a similar situation that I have found a way around.
>
> For every record INSERTED into my db I used the triggers to
associate
> the message to a client and client application. I have listeners
> that process records based on the ApplicationId assignedto the
record
> based on certain rules. The event that is raised uses the
> ApplicationId as the event name in the AFTER_INSERT trigger, ie
>
> POST_EVENT NEW."ApplicationId";
>
> The listeners configuration contains which ApplicationIds they
> process and so when they are loaded they modify the TIBEvents
> component and register the event(s). Upon receiving the event the
> query the db for records and process them...etc etc
>
> Hope this helps
>
> --- In firebird-support@yahoogroups.com, "russellbelding"
> <russell@b...> wrote:
> > I am using After-Insert, After-Update and After-Delete triggers
and
> > in them POST_EVENT lines to signal that a table has changed to
> > listeners. So my statements are like
> > POST_EVENT 'EVENT_NAME'
> > TO receive these events clients register as a listener
> > for 'EVENT_NAME'.
> >
> > If I am the client who made the event happen I do not want to act
> on
> > the event. If another client made the event happen I want to take
> an
> > action.
> >
> > If listeners could register to be notified for
events 'EVENT_NAME*'
> > they could get notification of events named
> > 'EVENT_NAME001', 'EVENT_NAME002' and so on. But Firebird does not
> yet
> > permit having wildcards in listener registration (does it?).
> >
> > Is there any reliable way for me to not act on an event I have
> > caused?
> >
> > Thanks for any suggesions.
> >
> > Russell Belding