Subject RE: [firebird-support] Concurrent Usage Limiting via Application
Author Kevin Stanton
I use this same technique as well using IB Objects. I've subclassed the
IB_Connection component and added a maxusers property. This property is
actually set at application start up accessing a table in the database that
contains a license count field. That compared to IB_Connection.Users will
limit logins.



[] On Behalf Of Stefan Heymann
Sent: Friday, May 12, 2006 8:34 AM
To: Tom Conlon
Subject: Re: [firebird-support] Concurrent Usage Limiting via Application

Hi Tom,

> FB is currently our default database
Same here :-)

> and if anyone has any tips on how to handle/limit concurrent usage
> from an application then it would be appreciated.

The only thing you can currently do is retrieve a list of the names of
the users that are connected to the database (including yourself).

When you use Delphi and IbObjects you can use the IB_Connection.Users
property to get this list.

When I start my application, I retrieve this list and count the number
of currently attached users. As I don't use the Firebird security
mechanism to authenticate users (there is my own USERS table in my
database, which I find more convenient), all my users attach to the
database using the same Firebird user name. I only count the
connections from this user name so users that are connected as, say,
SYSDBA will not be counted (e.g. administrators using a DB tool).

> We currently use a per-machine registration code but would like to
> monitor and limit connections instead.

That's difficult and unprecise. Mainly because ...

> Also, does anyone know if it possible to track untimely client
> disconnections?

... of this one: it's not possible. When a connection gets lost, the
Firebird server still keeps them in its list. The only way to reset
the list seems to be a restart of the Firebird service.

However, in firebird.conf there is a setting DummyPacketInterval, the
description mentions KEEPALIVE messages:

> # Seconds to wait on a silent client connection before the server sends
> # dummy packets to request acknowledgment.
> #
> # DO NOT USE THIS OPTION. It may hang or crash Windows on the client side
> # explained here:
> # or may not prevent eventual inactive client disconnection for other OS.
> #
> # Normally, Firebird uses SO_KEEPALIVE socket option to keep track of
> # active connections. If you do not like default 2-hour keepalive timeout
> # then adjust your server OS settings appropriately. On UNIX-like OS's,
> # modify contents of /proc/sys/net/ipv4/tcp_keepalive_*. On Windows,
> # follow instrutions of this article:
> #

Maybe the last article on Microsoft's homepage can help. I didn't try
that so far but "DO NOT USE THIS OPTION" doesn't sound very
encouraging ...

Being able to get a list of connected users with their IP address, OS
user name, client application name/identifier and timestamp of
connection would be my number one wish for any future release of
Firebird. For me, that would be more important and helpful than, say,
further speed improvements of the SQL query optimizer ...

Best Regards


Stefan Heymann


Visit and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at



al+support&c=6&s=196&.sig=-XIO8GxY6hqd3NaD5WSEyw> support

t+technical+support&c=6&s=196&.sig=B29J78SYXnNTjjMFBMznqA> technical

icrosoft+technical+support&c=6&s=196&.sig=7_je1A94xs82CFXUjEqA6g> computer
technical support

technical+support&c=6&s=196&.sig=2zMAuRCo5cJrVBr1Bxa3_w> technical support

icrosoft+technical+support&c=6&s=196&.sig=_ytYU7aXb57AVaeUfmvLcA> packard
technical support

ft+technical+support&c=6&s=196&.sig=4hRo6NXYavRAbTkaYec5Lw> technical



* Visit your group "firebird-support
<> " on the web.

* To unsubscribe from this group, send an email to:

* Your use of Yahoo! Groups is subject to the Yahoo!
<> Terms of Service.


[Non-text portions of this message have been removed]