pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to check if a connection is alive ?
2+ messages / 2 participants
[nested] [flat]
* How to check if a connection is alive ?
@ 2004-01-14 03:29 Andreas <maps.on@gmx.net>
0 siblings, 1 reply; 2+ messages in thread
From: Andreas @ 2004-01-14 03:29 UTC (permalink / raw)
To: pgsql-odbc
Hi,
Access 2000
Postgresql 7.4.1
newest PG-ODBC
how can I check if a DAO- or ADO-connection is still alive ?
I'd like to maintain a connection to a remote PG server within my VBA code.
It should be opend when the users start the application and closed when
the app terminates.
There are longer times while the application is idle and then some times
when it hits the server very often.
E. g. I write a log in the DB where the app says who did when what.
I'd prefer not to strain the server and the LAN with permanent Conn
Open/Close sequences.
There will be at least one external user who enters the LAN via a SSH
tunnel over the internet.
This connection is naturally worse in responsivity than the internal LAN
and there are chances that the tcp/ip connection breaks or the ODBC
times out.
If Access runs into a stale connection it plays dead until it's ODBC
timer runs out and that can take a while.
It would be better if I could check somehow wether the connection is
still there, before sending a command over it.
Is there a way to do that ?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to check if a connection is alive ?
@ 2004-01-14 09:06 Richard Huxton <dev@archonet.com>
parent: Andreas <maps.on@gmx.net>
0 siblings, 0 replies; 2+ messages in thread
From: Richard Huxton @ 2004-01-14 09:06 UTC (permalink / raw)
To: Andreas <maps.on@gmx.net>; pgsql-odbc
On Wednesday 14 January 2004 03:29, Andreas wrote:
> Hi,
>
> Access 2000
> Postgresql 7.4.1
> newest PG-ODBC
>
> how can I check if a DAO- or ADO-connection is still alive ?
> I'd like to maintain a connection to a remote PG server within my VBA code.
> It should be opend when the users start the application and closed when
> the app terminates.
You could have a timer that calls a function that just runs "SELECT true" or
similar. If the query fails, you've lost your connection. Is that the sort of
thing you meant?
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-01-14 09:06 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 03:29 How to check if a connection is alive ? Andreas <maps.on@gmx.net>
2004-01-14 09:06 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox