Subject Re: how to get idle time in a database
Author Adam
--- In firebird-support@yahoogroups.com, "Jeremy Lim (Tm)"
<lim2000@...> wrote:
>
> I am using Delphi 7 with Firebird, any ways to handle this
requiment?
>

Some Delphi Components fire an event AfterInsert etc. You could
listen to these events and run another query in its own dedicated
transaction but through the same connection. This query would update
a LastUpdated timestamp in a table that you would have to create.

Of course this would cause an extreme amount of unneccessary load on
the database server, so you would have to keep track from the client
application of the last time you updated the record and ensure you
did not update it more than say once per minute.

The transaction would need to be dedicated and fast (commits as soon
as you update the timestamp). If you ran the update from within your
normal transaction, then the update to the record would not be
visible until after you commit, and you may mistakenly think there
has been no activity when it is simply isolation blocking your view
of the activity.

You would then need to define a threshold of what is too old, because
an abandoned connection would still be in that table. A clean
disconnect procedure could be told to remove the record immediately
before disconnect.

Adam

> ----- Original Message -----
> From: "Adam" <s3057043@...>
> To: <firebird-support@yahoogroups.com>
> Sent: Monday, April 17, 2006 6:36 PM
> Subject: [firebird-support] Re: how to get idle time in a database
>
>
> > --- In firebird-support@yahoogroups.com, "jeremylim2008"
<lim2000@>
> > wrote:
> >>
> >> In fire bird 1.5 how can I check this connections
> >> had been idle for how long without update or insert
> >> to database.
> >>
> >
> > This can not be done from within the database.
> >
> > Adam
> >
> >
> >
> >
> >
> >
> >
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Visit http://firebird.sourceforge.net and click the Resources item
> > on the main (top) menu. Try Knowledgebase and FAQ links !
> >
> > Also search the knowledgebases at http://www.ibphoenix.com
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Internal Virus Database is out-of-date.
> > Checked by AVG Free Edition.
> > Version: 7.1.375 / Virus Database: 268.2.1/278 - Release Date:
09/03/2006
> >
> >
>