Page 1 of 1

Problem with TZConnection.PingServer

Posted: 31.03.2008, 13:38
by zitoune
Hi,
I'm new on this forum, and I use ZeosLib (6.6.1-geta and 6.6.2 rc) with a Delphi application and PostgreSQL database. I wish test my connection to the server with the function "PingServer" of my TZConnection variable. But when I call it, I have an error exception : "Unsupported operation"...

Can somebody help me please?

Olivier

Posted: 31.03.2008, 15:29
by mdaems
Hi Olivier,

It means : the ping operation is not (yet?) supported for PostgreSQL. Only for mysql at the moment. If you have some experience in programming using the PG dll's directly, you can certainly help us implementing this.

Main purpose of the function : If you have a connection to the server and you want to be sure the server is still there before triggering some new database actions (eg a refresh after the program was idle for some time), you can call PingServer. If this function returns true you can go on. If not, you should try to reconnect or close your connection.
For mysql ping also tries to reconnect before returning. This comes in very handy when there was just some small (network?) problem that caused the server to be unavailable for some time. But I don't know if this is possible for other database implementations.

Mark