RE: [firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-23 Thread m_brahi...@yahoo.fr [firebird-support]
I am sorry and I am confused.

I registered event with 'DISCONNECT_USER' instead of 'DISCONNECT_USER]' I 
forgot the bracket and now it works for the 1st scenario and not for the second 
because I was wrong with using  'DISCONNECT_USER]'||:USR in the PS and 
certaintly doesn't work but It give me an  idea. I will try from the client to 
loop through all users existing in the DB and register them with  
'DISCONNECT_USER]'+Users[i] 
I don't know if I can register more than hundred users in the client in case 
the number of users will increase in the futur. Thanks. 



RE: [firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-23 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]

> 2-POST_EVENT 'DISCONNECT_USER]'||:USR; (I splitt the event name using
> "]" in the client in order to retrieve the event name part and the username
> part) It is not fired

What event is your application registered/listening for?

'DISCONNECT_USER]', or 'DISCONNECT_USER]'||:USR?


Sean



Re: [firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-23 Thread Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
Hi,

> Yes in my delphi application I registered the event name
> I tried POST_EVENT in a stored procedure but without DELETE FROM 
> MON$ATTACHMENTS statement
> sometimes it is fired sometimes not. I didn't understand why
> 
> 
> When I write the event name like this :
> 
> 1-POST_EVENT 'DISCONNECT_USER';
> It is fired
> 
> 2-POST_EVENT 'DISCONNECT_USER]'||:USR; (I splitt the event name using 
> "]" in the client in order to retrieve the event name part and the 
> username part)
> It is not fired
> 
> And when I back to 1 when it worked it is not fired at all

Did you commit the transaction executing POST_EVENT in all scenarios? 
Events are delivered to the listening client upon transaction commit.


-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.


Re: [firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-23 Thread m_brahi...@yahoo.fr [firebird-support]
Hello,

Yes in my delphi application I registered the event name
 I tried POST_EVENT in a stored procedure but without DELETE FROM 
MON$ATTACHMENTS statement
 sometimes it is fired sometimes not. I didn't understand why
 

 

 When I write the event name like this : 
 

 1-POST_EVENT 'DISCONNECT_USER';
 It is fired
 

 2-POST_EVENT 'DISCONNECT_USER]'||:USR; (I splitt the event name using "]" in 
the client in order to retrieve the event name part and the username part)
 It is not fired
 

 And when I back to 1 when it worked it is not fired at all 
 

 Anyway I kept that idea of running POST_EVENT in SP and after waiting  I 
execute the delete statement.
 I consider that my problem is solved
 

 Thank you very much to all


Re: [firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-23 Thread 'Thomas Steinmaurer' t...@iblogmanager.com [firebird-support]
> Hello,
> 
> I am deleting user connected with:
> DELETE FROM MON$ATTACHMENTS WHERE MON$ATTACHMENT_ID = :ID_CONNECTION;
> 
> I need to use POST_EVENT in order to notify user that he has been disconnected
> but don't found a trigger for MON$ATTACHMENTS to do it.  Can you please help 
> me
> ? 
> Thanks

As Sean has mentioned, when you "delete" the attachment, your "communication 
channel" back to the user is basically gone.

What you could do is to:
* Run a stored procedure with the POST_EVENT
* Wait X minutes
* Execute the DELETE FROM MON$ATTACHMENTS statement


The main problem here is that your "administration connection" need to post an 
event isolated to the targeted user, e.g. by including something unique for the 
user in the event name and the client application has proper events registered.



--
With regards,
Thomas Steinmaurer
http://www.upscene.com

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.



RE: [firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-22 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]


> I am deleting user connected with:
> DELETE FROM MON$ATTACHMENTS WHERE MON$ATTACHMENT_ID =
> :ID_CONNECTION;
> I need to use POST_EVENT in order to notify user that he has been
> disconnected but don't found a trigger for MON$ATTACHMENTS to do it.  Can
> you please help me ?

AFAIK, it is not possible to do what you want.

Once you have deleted the connection, all communication to the client is 
stopped.


Sean



[firebird-support] Firing event when deleting in MON$ATTACHMENTS

2017-10-22 Thread m_brahi...@yahoo.fr [firebird-support]
Hello,

I am deleting user connected with:
 DELETE FROM MON$ATTACHMENTS WHERE MON$ATTACHMENT_ID = :ID_CONNECTION;

 I need to use POST_EVENT in order to notify user that he has been disconnected 
but don't found a trigger for MON$ATTACHMENTS to do it.  Can you please help me 
? 
Thanks