1. Berka Frenfert
  2. PowerBuilder
  3. Tuesday, 31 January 2023 07:30 AM UTC

 

Is there any way connection can be re-established and retrieve is resumed from same record connection was broken?

Sometimes due to network error DB connection is broken when retrieve is in progress and there is no way to resume retrival from the same record where it stopped because retrieve function discard previous rows and always start from row 1. 

Accepted Answer
Berka Frenfert Accepted Answer Pending Moderation
  1. Thursday, 11 May 2023 10:19 AM UTC
  2. PowerBuilder
  3. # Permalink

I completely ignored the idea to reconnect a broken DB connection.

Reason:

Andreas wrote

There should not be a way to reconnect and resume to a previous session - connection... Such a functionality could be a threat.

Andreas.

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 31 January 2023 12:05 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

What database are you using?

If it's Oracle, there's maybe a setting in the sqlnet.ora file that could solve your problems.

Comment
  1. Berka Frenfert
  2. Friday, 3 February 2023 15:18 PM UTC
another option i can think of is that A part of my PB app run on server and when receive SQL from B part on client side it created a datawindow from the received SQL. Then A part retrieve data from Db server on server side and fill up datawindow. B part then send request to the A part for range of rows.
  1. Helpful
  1. Berka Frenfert
  2. Friday, 3 February 2023 15:24 PM UTC
Hi Roland,

The connection break is no problem i have done it already. I mean i can reconnect and issue the same query again. I do it on retrieve button that checks if connection is still alive then send request otherwise issue connect statement and re send SQL.



I am looking for way to tell server side to return me range of rows resulted from the previously sent SQL. Or i can say this way that send me range of rows after running this SQL that i am sending now.



Range of rows is important because i want to resume loading of records thar were stopped due to connection failure.



Regards,

Berka
  1. Helpful
  1. Berka Frenfert
  2. Friday, 3 February 2023 15:37 PM UTC
I changed description of the question because it was creating confusion. Hope this time there will be no confusion. Please accept my apology
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 31 January 2023 12:47 PM UTC
  2. PowerBuilder
  3. # 2

Hi Berka;

   Your issue could actually be a DB "time out". That would give you the same DB Connection error. If that is actually your problem - a workaround for that is to use a "DB Heartbeat" feature. This basically negates the timeout by pinging the DB during "quiet" periods in you app where no DML is being exchanged. You can see feature at work in my STD Framework's "Demo" app. The heartbeat feature is DBMS independent.

Regards ... Chris 

Comment
  1. Miguel Leeuwe
  2. Friday, 3 February 2023 13:01 PM UTC
About responsibility: Indeed, it should be the network administrators to improve the network. In the case of that company I described before, there were thousands of users and lots of burocracy, so the pb team ended up reconnecting. I'm not going to show any code, because it's NOT the way to go.

regards.
  1. Helpful 1
  1. Miguel Leeuwe
  2. Friday, 3 February 2023 13:02 PM UTC
(obviously that "company in Holland" was NOt using Oracle (sqlserver).)
  1. Helpful
  1. Berka Frenfert
  2. Saturday, 29 April 2023 08:13 AM UTC
Hi Andreas,

'Accept as answer' link is not there

There should not be a way to reconnect and resume to a previous session - connection... Such a functionality could be a threat.

That is what i believe is the right answer.





Regards,

Berka
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 3 February 2023 15:16 PM UTC
  2. PowerBuilder
  3. # 3

Use powerserver to run your application.

Have Powerserver running on a server on the same local network as the database server.  That way you won't have any issues with the database drops.  

Comment
  1. Berka Frenfert
  2. Friday, 3 February 2023 15:35 PM UTC
Hi Mike,

That must be the easy way to handle this situation.

Unfortunately my buying power does not allow me to have PowerServer

I may find something similar like PowerServer does.



Regards,
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Sunday, 5 February 2023 18:47 PM UTC
  2. PowerBuilder
  3. # 4

After doing some googling: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/470144dc-ca05-4dea-a5b0-6a1e5212bea9/application-connection-to-sql-server-unstable?forum=sqldatabaseengine 

There appears to be a MAXDOP setting for the database, having to do with how many cpu cores will or can be used, that might help with solving similar problems. I'm not an expert of sql server, but it seems worth investigating.

regards.

Comment
  1. Berka Frenfert
  2. Monday, 6 February 2023 06:07 AM UTC
Hi, Miguel,

I will forward that information to the DB manager. Look like the SQL Express Version does not have that parameter.

EXEC sp_configure 'max degree of parallelism'

returns The configuration option 'max degree of parallelism' does not exist. I will check it on actual server.



Thank you
  1. Helpful
  1. Berka Frenfert
  2. Monday, 6 February 2023 06:16 AM UTC
I am sorry again. The MAXDOP exist in SQL Server Express Edition 2008 R2. further detail can be found here



https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option?view=sql-server-ver16
  1. Helpful
  1. Berka Frenfert
  2. Monday, 6 February 2023 07:30 AM UTC
  1. Helpful
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.