Have managed to work on something; first have created a timer(5) under the timer have run "Select 1 from DUMMY" then test if connection still exists. If the connection is broken then reconnect the database.
if sqlca.sqlcode <> 0 then Disconnect using SQLCA; Connect using SQLCA; end if
Exactly Armeen... Inline DB transactions in progress are either lost or they will crash. Also, the Disconnect / Connect breaks all DW Controls and DataStores that have already performed a SetTransObject() command. Not to mention DC/DS ShareData() commands. KaaBoom!
The Transaction Object's DBError event (aka SQLCA) and the DataWindow Control / DataStore DBError event will fire when this problem arises. Your PB App can then check for the 08051 error code and then inform the App user of the "unable to continue" due to network / DBMS connection issue. Basically at this point, the only safe thing you can do is restart the PB App via the ReStart() PowerScript command.
For the long term, the key is to find out why the network / DBMS connection keeps dropping.
An "SQLState 08501" error is basically a "Communication link failure". Either your cloud network is unstable or your App has been timed out. This is not a problem with PC, rather how any C/S app tries to stay connected to a Cloud based DBMS.
2. Is there a way i can auto-reconnect when there is a "communication link failure"?
The reason am you using the PowerClient is because the client is not ready to purchase powerserver License, For PowerClient the only requirement is PowerBuilder CloudPro Which i have.
The database is hosted in the cloud while the application on the premise. The client wants to maintain client/server. Where each user will need to configure odbc connection to the server.
There is no best way to acheive that with PowerClient. You aren't going to have reliable operation unless your Internet connection is extremely stable for every single user. There is reason why Web apps use HTTP rather than TCP/IP. The answer is to use PowerServer.
There are no replies made for this question yet. However, you are not allowed to reply to this question.
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.
All this is because am constrain to use PowerClient because with powerserver i will not have any issue.
For the long term, the key is to find out why the network / DBMS connection keeps dropping.