Subject Re: [firebird-support] Action on disconnect
Author Woody (TMW)
> >>I've asked this on the Interbase newsgroup, and they say it's not
> >>possible. Can this be done with FireBird? If not, wouldn't this be a
> >>useful (and simple) thing to implement?
> >>
> >>
> >
> >I don't know. What would be trapped? Who or what would trap it? What
> >would the purpose be?
> >
> Well, it would open a door of new possibilities. For example, I have an
> application in which I log all user connections and disconnections to
> the database. The way I do it is insert a row into a log table when the
> application starts up, and at shutdown, I update the record with the
> disconnection time. My problem is that when a user's connection to the
> database gets cut without the application having been closed properly
> (for example if the application hangs, or if there's a network problem),
> I have no way of updating the record, so it looks like the user is still
> connected.
>

I also log the users on and off in an entry table. Each time the user logs
in, it checks the table to see if a previous entry is there. If it is, then
it is checked to make sure they logged in and out properly. If there is no
log out time for them, then a message is sent to the administrator giving
them an indication that the user may have a connection problem. If this
happens often, then some testing can be done to check things like cables,
net cards, etc. If a user can log in on different machines, then a machine
ID could also be used so it could distinguish between the log-ins. If the
previous entry is correct, then I delete it and create a new one so the
table doesn't fill up with non-essential information.

Woody (TMW)