Connecting to Postgres -Reconnecting

Omnis omnis at lineal.co.uk
Fri Sep 6 05:18:32 EDT 2019


Very nice.

Mike


[Lineal Software Solutions]         <http://www.lineal.co.uk>

[Twitter]<https://twitter.com/linealsoftware> [Facebook] <https://www.facebook.com/linealsoftware?fref=ts&ref=br_tf>  [Google +] <https://plus.google.com/112982815000763473226/about>  [LinkedIn] <https://www.linkedin.com/company/1859834?trk=tyah&trkInfo=clickedVertical%3Acompany%2Cidx%3A1-1-1%2CtarId%3A1437729256906%2Ctas%3Alineal%20s>

[https://s3.amazonaws.com/htmlsig-assets/spacer.gif]

Mike Matthews
omnis at lineal.co.uk<mailto:omnis at lineal.co.uk>

Lineal Software Solutions
01271 375999
Commercial House, The StrandBarnstaple, Devon, EX31 1EU
www.lineal.co.uk<http://www.lineal.co.uk>


[http://www.lineal.co.uk/stuff/EmailSig/MicrosoftPartner.png]<http://www.lineal.co.uk/windows-support/> [http://www.lineal.co.uk/stuff/EmailSig/Office_365.png] <http://www.lineal.co.uk/microsoft-office-365/>  [http://www.lineal.co.uk/stuff/EmailSig/Cisco.png] <http://www.lineal.co.uk/wifi-networks/>  [http://www.lineal.co.uk/stuff/EmailSig/Meraki.png] <http://www.lineal.co.uk/wifi-networks/>  [http://www.lineal.co.uk/stuff/EmailSig/Dell.png] <http://www.lineal.co.uk/it-systems/>  [http://www.lineal.co.uk/stuff/EmailSig/Gamma.png] <http://www.lineal.co.uk/gamma-horizon-voip/>  [http://www.lineal.co.uk/stuff/EmailSig/Kerio.png] <http://www.lineal.co.uk/kerio/>  [http://www.lineal.co.uk/stuff/EmailSig/Apple.png] <http://www.lineal.co.uk/apple-upgrades-repairs/>  [http://www.lineal.co.uk/stuff/EmailSig/Eset.png] <http://www.lineal.co.uk/eset-security-software/>  [http://www.lineal.co.uk/stuff/EmailSig/mitel.png] <http://www.lineal.co.uk/shoretel/>




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

Hi Guys

Have a look at these functions

https://www.postgresql.org/docs/current/functions-info.html

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 bigpond.net.au> 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
timeout
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
Else
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 bigpond.net.au
Web Site:- https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fataddata.com.au&c=E,1,7kyJceqL9nBt1sx14dEu3YNm8I5J49apZBmgSti2gZ0C4e9DbHQZaV1TxfBGuudSOy7my4Mx9Mb_rGWGkSjSiVo3srM_ROumsCDNUl5eb5k-exFMvRyY2S0,&typo=1








-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On
Behalf
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
instance
on AWS.

At some sites the user may leave the program running and connected
(normal),
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

https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.zoo-ink.com&c=E,1,hNWvH4HOVUVvaNQNkYuRjhtl6w4qWO2YwZgZKk4CW9vbmuGHcBB24B4bJ5QvPGBv1yI0cxF0iQe77oBkts0dxGkv34a8KYqotCUDc_4L9N0BWB8bbQDT2jgD&typo=1 <applewebdata://69E79D34-B861-4F1A-8A06-ECEE3CCD7D56>
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.perfectfit.net&c=E,1,Tu_wrSV0xeg9T7LZuQ_atISbLJPdX91SyZcJ_0ihu8Wh7hBJMXZbyxSFQnJLEP4B_yJX1FGWDm-nr6NHW2Po5TFq4UyiSrNyloWUcEFaRxpU0WF-iKj_cIlD&typo=1
alan at perfectfit.net
----------------------------------------------------




_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flists.omnis-dev.com&c=E,1,sOEA8ZUpjERFnOS9aSklwuD-1pxq-y_kDxF4ksbM_cVhGlSGZkyZx_bYXiwkrzz3q6p8uFo_TDqTqbr0xq3mpLB5wQAuqiGVLojEprv7RL44eNJZjg,,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flists.omnis-dev.com&c=E,1,r_S5FSDPZ3OupKC5vs0fKMJ64mSWe4bD5CJiZ0O1zcv0ewHzm_WS8irtgA1s_SzoZj1bhWbQZUSnRT8WASXa5aKTyi5LMAMMVjxVdxTw-mk,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com



--
Kind Regards,

Stephen Miller
_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flists.omnis-dev.com&c=E,1,nQeOOcHzfaQWL1UWw2jYU8o8ZyCV8PtFi5oiPlqb0C1JUTx6xdkwTvcx9MrvoTwTw5Yx3jxbs1heQbNMqJm94fDTglIuDhZzt5DWE8VuTnPuLmFcXUfSctg,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com




More information about the omnisdev-en mailing list