Skip to Content.
Sympa Menu

freetds - RE: Polling tables?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Varley, David(CBorn at Alcoa)" <David.Varley AT alcoa.com.au>
  • To: 'TDS Development Group' <freetds AT franklin.oit.unc.edu>
  • Subject: RE: Polling tables?
  • Date: Fri, 6 Sep 2002 10:10:57 +0800


James,

If you find a satisfactory way to achieve this please pass on the details!

What I'm doing at present is setting up a small table called "Changes"
that contains table names, timestamps and a counter. I have a stored
procedure
that will update this table, called by triggers on tables I want to monitor.

Entries in Changes let me monitor the last change to any table, as well
as a "KeepAlive" status. (Some tables are updated every second, if this
stops we know something in the field has died and can take action).

This allows me to check status and update accordingly with the minimum
of network activity (some clients are on slow and laggy net links).
One query, 1 response, and I get back info all the tables I'm interested
in that have changed, as well as info on possible dead clients or net links.

Its better, but its still a polled approach :(

Another technique on SQLServer lets you run local code on the server,
based on a trigger, etc. Can be very useful, you can set up code to fire
a message over a socket, copy a file, etc, but this requires you to have
that level of access to the server, not always a possibility in my
situation. Also running code locally on NT/W2K leads into lots of headaches
with user contexts, permissions, etc. (Again a problem for me!) You can end
up with a server with no screen on the other side of the world waiting on a
user dialog noone will see, and no permission to log in yourself...

Some other suggestions to this post appear to be suggesting holding an open
connection and getting notification messages? Sounds good, although I think
in my case I'd hit concurrent connection licensing problems in the
real-world.

David

> -----Original Message-----
> From: James Cameron [mailto:james.cameron AT hp.com]
> Sent: Thursday, 5 September 2002 9:31 AM
> To: TDS Development Group
> Subject: [freetds] Polling tables?
>
>
> FreeTDS user query ... is there a way to have the SQL server tell me
> when a table or row has been modified?
>
> At the moment, I place the SELECT in a loop, with a few seconds of
> sleep(), but that's a bogosity ... I hate polling; it creates load and
> still has a response delay. Is there a way I can wait for an
> UPDATE or
> INSERT by another connection on a particular table?
>
> SELECT @@VERSION
>
> Microsoft SQL Server 7.00 - 7.00.842 (Intel X86) Mar 2 2000 06:49:37
> Copyright (c) 1988-1998 Microsoft Corporation Enterprise Edition on
> Windows NT 4.0 (Build 1381: Service Pack 6)
>
> --
> James Cameron
> (james.cameron AT hp.com)
>
> http://quozl.linux.org.au/ (or)
> http://quozl.netrek.org/
>
>
> ---
> You are currently subscribed to freetds as:
> [David.Varley AT alcoa.com.au]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
>




Archive powered by MHonArc 2.6.24.

Top of Page