Subject Re: [IBO] Getting number of active users via MON$ATTACHMENTS?
Author Chuck Belanger
Thank you, Carlos.

The Qry I use is created for each call of the routine (done by a timer).
I added the IB_Transaction.commit. And still I am not getting the
correct results. Now I get 1 when I should have 2 and likewise there is
no change as I disconnect from the database (in IBExpert).  Still
getting those crazy large Mon$Attachment_IDs, too.

I still suspect that having falsely high IDs means something. As a test
I have a "do while not eof" and look at the
FieldByNAme('mon$attachment_id).asInt64. That is when I notice the 10 to
the 17th power IDs. Like I said they actually are 4 digits long now.

Any other thoughts?

Chuck

On 1/3/2019 7:53 AM, 'Carlos H. Cantu' listas@...
[IBObjects] wrote:
> 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
>
>
>
>
>
> ------------------------------------
> Posted by: "Carlos H. Cantu" <ibo@...>
> ------------------------------------
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> http://tracker.ibobjects.com - your portal to submit and monitor bug reports
> http://community.ibobjects.com - your portal to purchase and upgrade
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
>