Subject Re: [firebird-support] How to limit the number of concurrent users to a database
Author Alexandre Benson Smith
Em 13/6/2012 17:17, Fulvio Senore escreveu:
>> Besides the cases you pointed out, there is the case of client lost
>> conection.
>>
>> But I think that this is the easiest way to do it...
>>
>> The OP could tell us some more info like:
>> Do you want to count the simultaneous connections or the number of users
>> ? (ex. the costumer could have 10 valid users but are allowed to use
>> just 5 at a time)
>>
> My purpose is very simple. The users can install the program on any
> number of computers connected to a Firebird server, and I want to limit
> the number of simultaneous connections.
> So they could install it on 5 computers but, if they payed for 2
> connections, they will be able to use the program only on 2 computers at
> the same time.
>
> Fulvio
>

I would go for the Thomas's sugestion to use on connect trigger. *If*
you identify that lost connections (ungracefully client app exit) is a
concern, you could employ some logic into your app to update the last
time used in a table, and ignore any connection that is not used for 5
minutes (or any time you think is reasonable)