Subject | Re: [IBO] Getting number of active users via MON$ATTACHMENTS? |
---|---|
Author | Carlos H. Cantu |
Post date | 2019-01-03T15:53:04Z |
You need to commit the transaction associated to that IB_Cursor to get
"fresh" values from the monitoring tables, otherwise, it will always
return the same information, since a snapshot of the monitoring data
is taken when you run the select for the first time.
[]s
Carlos H. Cantu
eBook Guia de Migração para o FB 3 - www.firebase.com.br/guiafb3.php
www.FireBase.com.br - www.firebirdnews.org - blog.firebase.com.br
CBplcI> Hello:
CBplcI> How do we get the number of active users with IBO?
CBplcI> I tried to simply use a IB_Cursor with:
CBplcI> SELECT * FROM MON$ATTACHMENTS WHERE MON$STATE = 1
CBplcI> But if I connected or disconnected from the database via IBExpert, the
CBplcI> count stays the same. Although, querying in IBExpert gives the correct
CBplcI> number of active connections, i.e. 2, one for my program and one for
CBplcI> IBExpert.
CBplcI> As I experimented with different approaches, I noticed something that
CBplcI> might be a clue:
CBplcI> When I checked the MON$ATTACHMENT_ID in my code it was always the same
CBplcI> from record to record and consistently up around 10x17th power, although
CBplcI> different from one query to another. The actual IDs are 4 digits long,
CBplcI> and of course, different for each record.
CBplcI> Tried using IB_Connection.Users.Count but that includes all active and
CBplcI> inactive users. I could not find a way to isolate only active users.
CBplcI> Thank you for any help or suggestions!
CBplcI> Chuck Belanger
CBplcI> ---
CBplcI> This email has been checked for viruses by Avast antivirus software.
CBplcI> https://www.avast.com/antivirus
CBplcI> ------------------------------------
CBplcI> Posted by: Chuck Belanger <phytotech@...>
CBplcI> ------------------------------------
CBplcI> ___________________________________________________________________________
CBplcI> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
CBplcI> without the need for BDE, ODBC or any other layer.
CBplcI> ___________________________________________________________________________
CBplcI> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
CBplcI> keyword-searchable FAQ, community code contributions and more !
CBplcI> http://tracker.ibobjects.com - your portal to submit and monitor bug reports
CBplcI> http://community.ibobjects.com - your portal to purchase and upgrade
CBplcI> ------------------------------------
CBplcI> Yahoo Groups Links
"fresh" values from the monitoring tables, otherwise, it will always
return the same information, since a snapshot of the monitoring data
is taken when you run the select for the first time.
[]s
Carlos H. Cantu
eBook Guia de Migração para o FB 3 - www.firebase.com.br/guiafb3.php
www.FireBase.com.br - www.firebirdnews.org - blog.firebase.com.br
CBplcI> Hello:
CBplcI> How do we get the number of active users with IBO?
CBplcI> I tried to simply use a IB_Cursor with:
CBplcI> SELECT * FROM MON$ATTACHMENTS WHERE MON$STATE = 1
CBplcI> But if I connected or disconnected from the database via IBExpert, the
CBplcI> count stays the same. Although, querying in IBExpert gives the correct
CBplcI> number of active connections, i.e. 2, one for my program and one for
CBplcI> IBExpert.
CBplcI> As I experimented with different approaches, I noticed something that
CBplcI> might be a clue:
CBplcI> When I checked the MON$ATTACHMENT_ID in my code it was always the same
CBplcI> from record to record and consistently up around 10x17th power, although
CBplcI> different from one query to another. The actual IDs are 4 digits long,
CBplcI> and of course, different for each record.
CBplcI> Tried using IB_Connection.Users.Count but that includes all active and
CBplcI> inactive users. I could not find a way to isolate only active users.
CBplcI> Thank you for any help or suggestions!
CBplcI> Chuck Belanger
CBplcI> ---
CBplcI> This email has been checked for viruses by Avast antivirus software.
CBplcI> https://www.avast.com/antivirus
CBplcI> ------------------------------------
CBplcI> Posted by: Chuck Belanger <phytotech@...>
CBplcI> ------------------------------------
CBplcI> ___________________________________________________________________________
CBplcI> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
CBplcI> without the need for BDE, ODBC or any other layer.
CBplcI> ___________________________________________________________________________
CBplcI> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
CBplcI> keyword-searchable FAQ, community code contributions and more !
CBplcI> http://tracker.ibobjects.com - your portal to submit and monitor bug reports
CBplcI> http://community.ibobjects.com - your portal to purchase and upgrade
CBplcI> ------------------------------------
CBplcI> Yahoo Groups Links