Subject | firebird events parameters workarounds |
---|---|
Author | |
Post date | 2015-11-03T16:20:20Z |
Hi,
since firebird don't support parameters in events (at least last time i checked that)
the only solution i have found to get notification with the new inserted ID is by creating a logs table :
CREATE TABLE NOTIFICATIONS
(
ID_NOTIFICATION integer NOT NULL primary key,
NTF_ID integer
);
in an afterpost trigger of some table
begin
insert into NOTIFICATIONS (NTF_ID) values ( New.ID);
POST_EVENT 'NOTIF';
end
then in a client side when intercepting then event
Select NTF_ID from NOTIFICATIONS Where ID_NOTIFICATION = (select max(ID_NOTIFICATION) from NOTIFICATIONS)
does anyone use this approch in a real world application ?
i am wondering how this behave in a multiusers envirenement ?
how to be sure that the ID We recieve is the good one ?
what if two users click at the same time on the button that raise this notifications ?
what do you think guys about this problem ?