2 small or 1 big server? – SQL reconnect
For me, its a case of catching the SQL error, checking what the error
is, and if its a disconnect in some way, then logout, and login again.
Keep alive doesn’t always work!
So, I use table objects for SQL, I use a superclass, within which I have
a $sqlerror method which is called whenever there is a SQL error…
Set reference MyRef to $cinst.$statementobject
;; Communication link failure
Do method ReLogin
Quit method kFalse
Pools setup during login, and kept alive, are for sure a quicker way to
connect to the data, if you don’t lose the SQL connection, if you lose
the SQL connection then the pool needs reconnecting anyway, and by
definition you will make a new connection for each pool entry…
You can start with a pool of 1, and just resize as required…
Again in my superclass, when I want to use a pool entry, I check to see
if one is free:
Calculate $root.$sessionpools.[lcPoolName].$poolsize as
Just as long as your pool sql object is capable of doing its own $init
to connect properly.
Hope something helps here…
Based in Chester in the UK.
On 30/08/2017 06:41, ADJob wrote:
> But we do not have an API yet, so how do you handle reconnection then? Our attempt to do this results in hanging for a period while negotiating for connection.
> Our simple and dirty solution is to activate keepalive to avoid reconnection delays, but this means also a bunch of idle connections.
> I have read that pooling skips the ”negotiation” part of the connection. Just picking a free session.
> Any reconnection code that you are willing to share?
Manage your list subscriptions at lists.omnis-dev.com