Subject | Getting number of active users via MON$ATTACHMENTS? |
---|---|
Author | Chuck Belanger |
Post date | 2019-01-03T14:41:48Z |
Hello:
How do we get the number of active users with IBO?
I tried to simply use a IB_Cursor with:
SELECT * FROM MON$ATTACHMENTS WHERE MON$STATE = 1
But if I connected or disconnected from the database via IBExpert, the
count stays the same. Although, querying in IBExpert gives the correct
number of active connections, i.e. 2, one for my program and one for
IBExpert.
As I experimented with different approaches, I noticed something that
might be a clue:
When I checked the MON$ATTACHMENT_ID in my code it was always the same
from record to record and consistently up around 10x17th power, although
different from one query to another. The actual IDs are 4 digits long,
and of course, different for each record.
Tried using IB_Connection.Users.Count but that includes all active and
inactive users. I could not find a way to isolate only active users.
Thank you for any help or suggestions!
Chuck Belanger
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
How do we get the number of active users with IBO?
I tried to simply use a IB_Cursor with:
SELECT * FROM MON$ATTACHMENTS WHERE MON$STATE = 1
But if I connected or disconnected from the database via IBExpert, the
count stays the same. Although, querying in IBExpert gives the correct
number of active connections, i.e. 2, one for my program and one for
IBExpert.
As I experimented with different approaches, I noticed something that
might be a clue:
When I checked the MON$ATTACHMENT_ID in my code it was always the same
from record to record and consistently up around 10x17th power, although
different from one query to another. The actual IDs are 4 digits long,
and of course, different for each record.
Tried using IB_Connection.Users.Count but that includes all active and
inactive users. I could not find a way to isolate only active users.
Thank you for any help or suggestions!
Chuck Belanger
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus