Connecting to Postgres -Reconnecting

Omnis omnis at
Fri Sep 6 05:18:32 EDT 2019

Very nice.


[Lineal Software Solutions]         <>

[Twitter]<> [Facebook] <>  [Google +] <>  [LinkedIn] <>


Mike Matthews
omnis at<mailto:omnis at>

Lineal Software Solutions
01271 375999
Commercial House, The StrandBarnstaple, Devon, EX31 1EU<>

[]<> [] <>  [] <>  [] <>  [] <>  [] <>  [] <>  [] <>  [] <>  [] <>

On 6 Sep 2019, at 10:12, Stephen Miller <stephenmiller1958 at<mailto:stephenmiller1958 at>> wrote:

Hi Guys

Have a look at these functions

You can do a lot of powerful things with the PID and others.

On Fri, 6 Sep 2019 at 16:04, Chris Hughes <ataddata at> wrote:

There are 3 areas you can look at.

1.0 There is a timer in Postgres
Do tSessionObj.$logontimeout.$assign(680)     ;;Postgres DAM default
is 15 minutes... unbelievable. 480=8 hours

2.0 Some routers also have a time out.

3.0 I read in postgres you can check to see if you have a connection is Ok
by checking for example company details. If found it is ok do nothing, if
not re run the logon procedure. This is seamless.

Do LvObject.$GetDataBaseName Returns LvDataBaseName     ;; We check the
current connection to see if still connected to current database. Otherwise
we try and reconnect automactically to SQL server.
If LvDataBaseName=tProject     ;; Data base name
Calculate tLoginState as kTrue
Quit method kTrue
Else     ;; Down this leg we go and do another logon
Calculate tLoginState as kFalse
Switch tPlatform
Case 'postgres'
Do method $LogonPostgres (,tProject)     ;; Note parameter space.
Case 'sqlserver'
Do method $LogonSQLServer (,tProject)     ;; Note parameter space.
End Switch
If tLoginState=kFalse
OK message System Warning (Icon) {This fault indicates the connection the
SQL server has been lost, problems could be:-//Network Down.//Local Area
cable unpluged.//Please restart system.}
Quit all methods
Quit method kTrue
End If
End If
Quit method

Chris Hughes

Copious Data Pty Ltd (Trading as Atad Data)
Unit 8 /3460 Pacific Highway
Springwood QLD 4127
Phone No:- 07 3208 6347
Mobile No:- 0409 263 349
Fax No:- 07 3208 9347
Email:- ataddata at
Web Site:-,1,7kyJceqL9nBt1sx14dEu3YNm8I5J49apZBmgSti2gZ0C4e9DbHQZaV1TxfBGuudSOy7my4Mx9Mb_rGWGkSjSiVo3srM_ROumsCDNUl5eb5k-exFMvRyY2S0,&typo=1

-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at] On
Of Alan Grinberg
Sent: Friday, 6 September 2019 3:39 PM
To: OmnisDev List - English
Subject: Connecting to Postgres -Reconnecting

Hi all,

We have Studio 8.1 on local computers connecting to a PostgreSQL DB
on AWS.

At some sites the user may leave the program running and connected
and go away from their desk for 15 minutes or more.
When they return the connection has been lost, and they have to Exit and
sign on again (a pain).

Does anyone know of a way to avoid the lost connection (we have tried
various computer settings), or is there a way to have it check for a
connection when the user starts using the program again? Is there overhead
in checking the connection on each call to the server? It looks like the
session is lost. Is this in the design of our code or some other issue?

Thanks. Any help would be appreciated.

- Alan

Alan Grinberg
AG Systems/ZOO-INK
San Francisco, CA,1,hNWvH4HOVUVvaNQNkYuRjhtl6w4qWO2YwZgZKk4CW9vbmuGHcBB24B4bJ5QvPGBv1yI0cxF0iQe77oBkts0dxGkv34a8KYqotCUDc_4L9N0BWB8bbQDT2jgD&typo=1 <applewebdata://69E79D34-B861-4F1A-8A06-ECEE3CCD7D56>,1,Tu_wrSV0xeg9T7LZuQ_atISbLJPdX91SyZcJ_0ihu8Wh7hBJMXZbyxSFQnJLEP4B_yJX1FGWDm-nr6NHW2Po5TFq4UyiSrNyloWUcEFaRxpU0WF-iKj_cIlD&typo=1
alan at

Manage your list subscriptions at,1,sOEA8ZUpjERFnOS9aSklwuD-1pxq-y_kDxF4ksbM_cVhGlSGZkyZx_bYXiwkrzz3q6p8uFo_TDqTqbr0xq3mpLB5wQAuqiGVLojEprv7RL44eNJZjg,,&typo=1
Start a new message -> mailto:omnisdev-en at

Manage your list subscriptions at,1,r_S5FSDPZ3OupKC5vs0fKMJ64mSWe4bD5CJiZ0O1zcv0ewHzm_WS8irtgA1s_SzoZj1bhWbQZUSnRT8WASXa5aKTyi5LMAMMVjxVdxTw-mk,&typo=1
Start a new message -> mailto:omnisdev-en at

Kind Regards,

Stephen Miller
Manage your list subscriptions at,1,nQeOOcHzfaQWL1UWw2jYU8o8ZyCV8PtFi5oiPlqb0C1JUTx6xdkwTvcx9MrvoTwTw5Yx3jxbs1heQbNMqJm94fDTglIuDhZzt5DWE8VuTnPuLmFcXUfSctg,&typo=1
Start a new message -> mailto:omnisdev-en at

More information about the omnisdev-en mailing list