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.



Kevin





_____

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 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
as
> # explained here: http://support.microsoft.com/default.aspx?kbid=296265
> # 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:
> # http://support.microsoft.com/default.aspx?kbid=140325

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


--
Stefan Heymann
www.destructor.de/firebird



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





SPONSORED LINKS


Technical
<http://groups.yahoo.com/gads?t=ms&k=Technical+support&w1=Technical+support&
w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq
+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technic
al+support&c=6&s=196&.sig=-XIO8GxY6hqd3NaD5WSEyw> support

Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+technical+support&w1=Technical
+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&
w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsof
t+technical+support&c=6&s=196&.sig=B29J78SYXnNTjjMFBMznqA> technical
support

Compaq
<http://groups.yahoo.com/gads?t=ms&k=Compaq+computer+technical+support&w1=Te
chnical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+s
upport&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=M
icrosoft+technical+support&c=6&s=196&.sig=7_je1A94xs82CFXUjEqA6g> computer
technical support


Compaq
<http://groups.yahoo.com/gads?t=ms&k=Compaq+technical+support&w1=Technical+s
upport&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4
=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+
technical+support&c=6&s=196&.sig=2zMAuRCo5cJrVBr1Bxa3_w> technical support

Hewlett
<http://groups.yahoo.com/gads?t=ms&k=Hewlett+packard+technical+support&w1=Te
chnical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+s
upport&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=M
icrosoft+technical+support&c=6&s=196&.sig=_ytYU7aXb57AVaeUfmvLcA> packard
technical support

Microsoft
<http://groups.yahoo.com/gads?t=ms&k=Microsoft+technical+support&w1=Technica
l+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support
&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microso
ft+technical+support&c=6&s=196&.sig=4hRo6NXYavRAbTkaYec5Lw> technical
support



_____

YAHOO! GROUPS LINKS



* Visit your group "firebird-support
<http://groups.yahoo.com/group/firebird-support> " on the web.

* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>

* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.



_____



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