NO : Postgresql re-establishing connection

Ken Dimson kdimson at
Fri Dec 3 09:06:21 EST 2010

The Postgresql dam has the $connectstatus method which returns the status of the connection.

The dam also has a $reset method to reconnect to the server.

In my super table class $construct I experimented with the following although have not proven it works perfectly yet. I cannot remember if the test $connectstatus hangs if connection is lost which would defeat the purpose.

I test the connection and then do a $reset 
Do oSession.$connectstatus() Returns isConnected
If isConnected<>kPgSqlConnectionOK&oSession.$reset.$cando
Do oSession.$reset
End If

There is also a session property $state so one could test that as well

If oSession.$state=kSessionStateLoggedOn
do something such as $reset


On Dec-3-10, at 7:37 AM, Andy Hilton wrote:

> Postgres Gurus
> Is there an easy way (or any way !) within Omnis to re-establish a connection to Postgres in the event of a momentary lapse of network ?
> In MySQL I can use their ping command which does a nice job of re-establishing a connection if it was broken, and am looking for something similar in Postgres ?
> Andy_____________________________________________________________
> Manage your list subscriptions at

Ken Dimson
kdimson at

More information about the omnisdev-en mailing list