1. Aron Cox
  2. PowerBuilder
  3. Saturday, 20 May 2023 13:24 PM UTC

PowerBuilder 2019 R3 Build 2728

Windows 10 Enterprise 22H2

 

We have a customer who has upgraded from a pretty old version of our software to a more recent one, and they are complaining that a window now takes over 10 minutes to retrieve.

After some investigation I see the actual database retrieves are still relatively fast and in fact the issue is there a call to SetFocus() when the progress bar window is closed. I assume to ensure the main window is brought back to focus when the progress bar is no longer required. This is ancestor code that hasn't been changed for a long, long time.

Commenting this SetFocus() out reduces the the time taken by a little over 10 minutes. I also took out any code in the Activate event in case that is doing something, to no avail, still 10 minutes.

So I ran a Trace using TraceOpen with TraceEnableActivity(ActLine!) etc and I get the following:

Execute tracebegin(ReadOnly string) errorreturn: 0.0000
Execute window.setfocus() integer: 661.1192
   Execute 'dw_sheet.getfocus() long: 0.0000
      Line 1: 0.0000 := call super::getfocus;//is_last_dw = "DW_SHEET"
      Execute datawindow.getfocus() long: 0.0000
      Line 2: 0.0484 := end event
Execute traceend() errorreturn: 0.0001 

So, isn't this saying nothing else happened except for the call to SetFocus, which took 661 seconds to complete (it is set to display in seconds)?

Anyone have any tips on how I can track down where the 10 minutes is coming from? Events I should look at, traces I could do?

I could of course just stop the SetFocus being called for this particular window, but I feel like I shouldn't have to.

One thing to note it the datawindow has 165,000 rows in it after retrieval, and this seems to be the reason why SetFocus is taking so long. It's not an issue when there are less rows.

Thanks very much for any help!

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 20 May 2023 15:56 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Aron;

  1. Is this App user running the App from a File server?
  2. Is the App user using RDT / Citrix / etc to run your App?
  3. Did you create a custom PB.ini file that gets deployed with the PB App's EXE?

Custom PB.ini critical settings ...

[Data Window]
Accessibility=0

[DataStore Behavior]
UseHwnd=no

Regards ... Chris

Comment
  1. mike S
  2. Saturday, 20 May 2023 16:17 PM UTC


agreed, with that number of rows, make sure:

[Data Window]

ACCESSIBILITY=0



is set in the pb.ini in the application's directory

  1. Helpful 1
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Monday, 22 May 2023 18:41 PM UTC
  2. PowerBuilder
  3. # 1

... and it fixed another issue with the same customer where a report crashed out to a blank screen after retrieval. So that was handy smile

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 22 May 2023 13:04 PM UTC
  2. PowerBuilder
  3. # 2

Hi Aaron;

  Just note for when you upgrade to PB 2022 ... the Accessibility setting is now OFF by default. So you won't need the custom PB.ini file any longer unless you want to turn that feature on. So you could consider dropping the custom PB ini file in that or higher PB releases when deploying. 

Regards ... Chris 

Comment
  1. Aron Cox
  2. Monday, 22 May 2023 18:44 PM UTC
Thanks Chris, noted
  1. Helpful
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Sunday, 21 May 2023 12:55 PM UTC
  2. PowerBuilder
  3. # 3

Sorry for the delay in replying, for some reason this website wasn't working for me until now!

Thanks everyone, this was resolved by adding the Acessibility=0 option to a PB.INI file.

The SetFocus went from over 10 minutes to 0.003 seconds. I'll do some more testing this week.

THanks for your help, the PB.INI did not cross my mind as a solution at all!

On to the next problem the same customer is reporting, wonder if they're related!

Comment
  1. John Fauss
  2. Monday, 22 May 2023 04:52 AM UTC
Would you please take a moment and mark this question as resolved, Aron? Thanks!
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 22 May 2023 05:43 AM UTC
@Aron: same problem here yesterday, page never ended loading and was constantly asked to "wait or cancel".
  1. Helpful
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Sunday, 21 May 2023 05:17 AM UTC
  2. PowerBuilder
  3. # 4

Hi Aron

do you have computed columns in the DW? Maybe they need a lot of time to be calculated. Try SetRedraw( FALSE ) before the SetFocus() and switch it back after it.

Regards
Arthur

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Saturday, 20 May 2023 15:12 PM UTC
  2. PowerBuilder
  3. # 5

Hi Aaron, if you can provide a reproducible test case, please open a support ticket our engineers can do some advanced troubleshooting.  SetFocus is popular feature and we don’t have widespread performance issue so test case will be critical so our engineers can help.  Thanks.

Comment
  1. Aron Cox
  2. Monday, 22 May 2023 06:38 AM UTC
Sorry, was trying all day yesterday but the site wasn't working. Seems to be back now
  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.