Subject | Re: [firebird-support] How to limit the number of concurrent users to a database |
---|---|
Author | Ann Harrison |
Post date | 2012-06-13T16:21:07Z |
On Wed, Jun 13, 2012 at 11:39 AM, Fulvio Senore <mailing@...> wrote:
where blocking
garbage collection for the duration of a connection would be catastrophic.
its "lock" removed.
Good luck,
Ann
[Non-text portions of this message have been removed]
>It really depends on your application profile - there are applications
> I have created a custom table, with as many rows as the maximum expected
> number of users. For my program this number will be very small. If the
> user wants a lot of connections there is an unlimited version.
> Each row contains an ID (primary key) and a dummy field.
>
> When a program tries to connect to the database it issues a "SELECT ...
> WITH LOCK" statement in a no-wait transaction, trying to lock the first
> row. If it gets a lock error the row is locked by another user so the
> program tries to lock the second row, and so on.
>
> This solution has the disadvantage of blocking garbage collection so
> each program could commit the locking transaction from time to time.
> This should solve the garbage collection problem.
>
where blocking
garbage collection for the duration of a connection would be catastrophic.
> If a program crashes I suppose that the row will remain locked from someAfter a crash, the transaction that took the lock will be declared dead and
> time, but I don't know how long it will remain locked. Does anybody know
> this locking time?
>
its "lock" removed.
Good luck,
Ann
[Non-text portions of this message have been removed]