Subject Re: How to limit the number of concurrent users to a database
Author technisoft2005
--- In firebird-support@yahoogroups.com, Tomasz Tyrakowski <t.tyrakowski@...> wrote:
>
> On 2012-06-14 07:43, technisoft2005 wrote:
>
> > 2 Crashing server or network. On loading the program
> > it checks how many connection there are to the database.
>
> And how exactly are you going to do it? That would also solve the main
> problem, wouldn't it?
>
> Regards
> Tomasz
>
>
> > If there is only one connection and this connection is itself, the program runs a cleanup routine setting IN_USE of all records (except its own) to 0.
> > On all systems this happens at least once a day, i.e. there are no 24/7 systems out there.

It depends on the version of the FB server installation and the database ODS. If monitoring tables are present I use them to determine if there is a single attachment. One has to deal with the sweeper thread which might upset the count. It is also not quite straight forward to use the mon$attachment table as it is conceivable that a program or modules thereof may create multiple attachments from the same workstation and user.
If no monitoring tables are present then I use the capabilities of the FIBplus database connection component. This returns a server wide count as opposed to a database specific count.

Peter