1. Heiko Betzler
  2. PowerBuilder
  3. Friday, 15 May 2020 12:58 PM UTC

Hello everybody,

we are using:

  • PB2019 (2082)
  • SQL Anywhere 17
  • using PFC
  • typical Client-Server application

 

If we have a window, which has a business object with some datastores, the opening of the window is very slow, when all the datatstores will be retrieved during the opening process. 

The problem of the slowing down is not a big amount of data or a complex SELECT, the problem is the "Ping-Pong-Conversation" for each single retrieve between the client and the database server.

For example:

  • ds_1.retrieve: 
    ds_1.retrieve: wait for result from server
  • ds_2.retrieve: 
    ds_2.retrieve: wait for result from server
  • ...
  • ds_n.retrieve: 
    ds_n.retrieve: wait for result from server

 

If the ping-time are very bad (eg. using WLAN or using mobile cellphone connection), the total time for opening a window increases many times over.

 

We think, this is a general Problem, when using PowerBuilder and a typical client-server architecture.

  • Is there a easy solution? Maybe a configuration option, to combine serveral Retrieves within one Ping-Pong-Connection?
  • Or is it possible to start a kind of transaction, prepare the Datastore-Retrieves and send them together to the server?

 

Thanks in advance for your ideas.

Best regards

Heiko

 

 

 

 

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 15:33 PM UTC
  2. PowerBuilder
  3. # 1

Hi Heiko;

  In most of the Apps where I have seen this issue, were easily solved by:

1) Only retrieve the DS's when they are needed (just in time processing)

2) Move the DS retrieve's to Shared Object's (lazy retrieve's - aka background)

3) Move the DS retrieve's to POST Open / Constructor events where possible.

4) Remove sorting and filtering DW commands until after the retrieves

5) Move initial data sorting to the DBMS side from PB's DWOs.

6) Use a DB "native" driver where possible.

7) Use a "RetrieveAsNeeded" approach and only complete the full retrieval on a POST Open/Close event or better yet - only when the full result set is absolutely needed in the processing cycle.

8) Optimize your SQL (ie: https://support.quest.com/sql-optimizer-for-sql-server/10.1.2).

Food for thought.  ;-)

Regards ... Chris

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 14:42 PM UTC
  2. PowerBuilder
  3. # 2

Maybe a crazy approach, depending on how much effort this would cost:

Try getting all the information you need on a single datastore, maybe using VIEWS or UNION ALL.

You can add a type column to the UNION's Selects to identify the difference between the ds's you had initially.

You'd only have to do one retrieve and suffer the latency once.

 

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 14:36 PM UTC
  2. PowerBuilder
  3. # 3

Client/server architecture programming practices typically don't consider latency of network connection because it is meant to be used in LAN not WAN.  The "best practice" way these days to solve your issue would be to move your business/data logic into REST APIs using PowerScript Migrator and then call the REST API from your PowerBuilder UI using the RESTClient object.  Basically, you are moving the ping-pong you talk about from your client to the server so ping pong happens on low latency connection.

Comment
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.