1. mathews rutto
  2. PowerServer
  3. Tuesday, 14 December 2021 14:01 PM UTC

Hi,

Am getting this error when i run PowerClient. How do i resolve this?

mathews rutto Accepted Answer Pending Moderation
  1. Thursday, 16 December 2021 19:23 PM UTC
  2. PowerServer
  3. # 1

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

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 16 December 2021 20:07 PM UTC
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!
  1. Helpful
  1. mathews rutto
  2. Friday, 17 December 2021 09:26 AM UTC
Then is there away i can only detect when there is connection breakdown so that i can do reconnecting?

All this is because am constrain to use PowerClient because with powerserver i will not have any issue.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 17 December 2021 16:03 PM UTC
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.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 December 2021 20:06 PM UTC
  2. PowerServer
  3. # 2

Hi Mathews;

  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.

Regards ... Chris

Comment
  1. mathews rutto
  2. Wednesday, 15 December 2021 06:44 AM UTC
Thank you.

1. How do set up app timeout?

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.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 15 December 2021 17:47 PM UTC
Hi Mathews;

1) Timeouts are typically controlled in two ways: 1) Cloud setup (network wise) and 2) DBMS wise. Please check with your Cloud and DBA teams.

2) Not that I am aware of. AFAIK: you can only detect the issue and then do an App Restart().

Regards ... Chris
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 December 2021 17:00 PM UTC
  2. PowerServer
  3. # 3

Are you using PowerClient or PowerServer?  

Are you running the app over the Internet?

Comment
  1. Marco Meoni
  2. Tuesday, 14 December 2021 17:57 PM UTC
yes, 08S01 typically refers to TCP/IP network failure
  1. Helpful 1
  1. mathews rutto
  2. Tuesday, 14 December 2021 18:01 PM UTC
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.



whats the best way to archive with powerclient?
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Tuesday, 14 December 2021 18:03 PM UTC
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.
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.