we need to discover the number of active connections to a database but the database has no "mon$" tables available and every client connects with the same user name.
so neither a "select * from MON$ATTACHMENTS" nor "TIBCConnection.DatabaseInfo.UserNames.Count" will work here.
we tried to make an api call on "isc_database_info()", using the handle of a "TIBCConnection" but didn't get this to work.
do you have any suggestion how to resolve this?
thanks in advance
discover number of active connections [SOLVED]
discover number of active connections [SOLVED]
Last edited by petersen on Wed 24 Sep 2014 14:58, edited 1 time in total.
Re: discover number of active connections
When retrieving the TIBCConnection.DatabaseInfo.UserNames property value, IBDAC uses an API function isc_database_info with a parameter isc_info_user_names. So you can use this property to retrieve the number of active connections to the database.
Re: discover number of active connections
but "TIBCConnection.DatabaseInfo.UserNames.Count" will be "1" - even if there are a lot more connections established with the same user-name (f.i. 100 connections with "SYSDBA"), right?
Re: discover number of active connections
As we wrote above, when retrieving the TIBCConnection.DatabaseInfo.UserNames property value, IBDAC uses an API function isc_database_info with a parameter isc_info_user_names.
You can refer to the Firebird documentation to learn how this API function works.
You can refer to the Firebird documentation to learn how this API function works.
Re: discover number of active connections
looks like we have this problem (multiple connections active but only a single entry for a username) with ibdac under xe5?!
SELECT COUNT(*) FROM MON$ATTACHMENTS WHERE MON$USER = 'SYSDBA';
-> 3
TIBCConnection.DatabaseInfo.UserNames.CommaText
-> SYSDBA,SYSDBA,SYSDBA (XE, IBDAC 4.6.12)
-> SYSDBA,SYSDBA,SYSDBA (XE, IBDAC 5.4.10)
but
-> SYSDBA (XE5, IBDAC 5.3.9)
-> SYSDBA (XE5, IBDAC 5.4.10)
any suggestions?
SELECT COUNT(*) FROM MON$ATTACHMENTS WHERE MON$USER = 'SYSDBA';
-> 3
TIBCConnection.DatabaseInfo.UserNames.CommaText
-> SYSDBA,SYSDBA,SYSDBA (XE, IBDAC 4.6.12)
-> SYSDBA,SYSDBA,SYSDBA (XE, IBDAC 5.4.10)
but
-> SYSDBA (XE5, IBDAC 5.3.9)
-> SYSDBA (XE5, IBDAC 5.4.10)
any suggestions?
Re: discover number of active connections
we finaly found the problem:
on the xe5 machine we installed the firebird-server with the "-classic -multithreaded" switches! after changing to "-superserver", "TIBCConnection.DatabaseInfo.UserNames.Count" shows the correct number of connections
on the xe5 machine we installed the firebird-server with the "-classic -multithreaded" switches! after changing to "-superserver", "TIBCConnection.DatabaseInfo.UserNames.Count" shows the correct number of connections
Re: discover number of active connections [SOLVED]
It is good to see that the problem has been solved. If any questions concerning our products come up, please contact us.