Subject Re: Scheduled tasks in IB
Author alex_vnru
--- In ib-support@y..., guido.klapperich@t... wrote:
> I'm thinking about a licence-mechanism for my app. I want to licence
the
> number of simultaneous connections, for example you have a
> 5-User-Licence, then 5 users can work simultaneous on the db. The
> problem is, when the pc of a user crashes, then he is marked in the
db
> as logged in, but he isn't. Therefore the client tells every 10
minutes
> the server I'm alive and when the client crashes, the server
recognizes
> after 10 minutes, the client is dead and marks the user as logged
out.
> But therefore I need a task, that checks all 10 minutes, if the user
is
> alive. How can I realize this with IB ?


Guido, how many transactions are performed on your database daily?
I suppose your users stops work and disconnects at the evening. If it
is 20 000 - 30 000 and your application mainly selects and inserts
data, you can try to create table with 5 rows, and on start of
application start transaction, try to update first row, if it's busy
(lock conflict) - second and so on, if all 5 are locked, refuse
connection. Commit this transaction at application stop. If one of the
connections crashes, row will be free after connection_timeout
interval - 3 minutes by default and configurable.
Disadvantage - it stops OAT/OIT moving and, on databases with more
heavy load or if application mainly updates and deletes data, can
decrease performance at the end of the day. Doing this you should also
turn off automatic sweep and make it manually or by AT/cron after last
user finished work, at night for example. This method is unacceptable
for 24*7 databases wich can be accessed in unpredictable time.

Best regards, Alexander V.Nevsky.

P.S. This Yahoo suddenly forgot my name and shows account instead. I
have no time to investigate this problem, sorry.