1. Aleš Vojáček
  2. PowerBuilder
  3. Monday, 19 December 2022 13:20 PM UTC

Hi all,

we have long running task (there is 30k rows in datawindow) and in for loop we are executing some checks using SQL queries.

We are using MSSQL as database PB2022 runtime 1892.

After cca 25 mins. Application ends with this error:

Problem Event Name:    APPCRASH

Application Name:    winzis12.exe

Application Version:    1.1.0.1

Application Timestamp:    63764527

Fault Module Name:    PBVM.dll

Fault Module Version:    22.0.0.1892

Fault Module Timestamp:    637645a5

Exception Code:    c0000005

Exception Offset:    0035b232

OS Version:    6.3.9600.2.0.0.400.8

Locale ID:    1029

Additional Information 1:    5861

Additional Information 2:    5861822e1919d7c014bbb064c64908b2

Additional Information 3:    8e2a

Additional Information 4:    8e2a2fd1219ab9916c34f5a7a4ce3a01

I added yield() every 100 rows.

It does not helped :-(

Do you have any suggestion? May be it can help to rewrite this to stored procedure, but it will take some time, any other suggestion how and why this error will occure?

Thank you.

Ales

 EDIT:

I'm sorry for this question, specially to those people which tried to help me out.

The app which had problems, was created log before I joined company. And there is "feature" in this app, which close response windows after 25 minutes. This batch (that cause problems) was started by response window and You gues what happend? The response window tries to close self after 25 mins :-( 

I'm sorry again and I will open beer for this problem solved.

Thank you All.

David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Wednesday, 21 December 2022 16:24 PM UTC
  2. PowerBuilder
  3. # 1

I would be inserting a garbagecollect() just before your yeild(). Also any objects that are created, make sure you destroy them after you are done with them. Your problem is most likely a memory issue.

Comment
There are no comments made yet.
Tomas Beran Accepted Answer Pending Moderation
  1. Tuesday, 20 December 2022 16:00 PM UTC
  2. PowerBuilder
  3. # 2

Hi

Are you sure you're not running two database requests in parallel?

You wrote: "I added yield() every 100 rows." Which means you use RetrieveRow event. According to my experience this is something which you must never use. It slows down the retrieval process significantly and it process the Windows message queue. So everything (timers, events, post messages) can happen there.

 

My advice:

25*60 = 1500. Isn't it your database idle timeout?

Try your query in a simple datastore. Create it, retrieve it and destroy it. If it still fails then:

Check the dataobject. Datawindows are sensitive to wrong column sizes. Like if your query contains a string or decimal bigger than the column in the datawindow then it crash.

Turn a full memory dump on

In windbg check what and where failed.

Comment
  1. Aleš Vojáček
  2. Friday, 23 December 2022 16:47 PM UTC
After some investigation and logging in place. I can say that after 25 mins. (every time I tried that batch) . Powerbuilder destroy datawindow there is error Null object reference for dw.getitemstring. But sript few rows before this happens I'm reading from exact row in this dw another column and this is successfull .

It is strange, I cannot find any timeout for 25 mins which I can chage. :-(
  1. Helpful
  1. Tomas Beran
  2. Tuesday, 27 December 2022 10:38 AM UTC
Just a guess: I expect you've doublechecked there's no destroy of the datawindow in your code at all. Isn't it just a sleep/hibernate timeout at the client's PC?



Another tip: Because you're yelding then your code doesn't block message routing and your application responses to OS sleep, hibernate and shutdown requests. In case your app is forced to turn off then Close is called directly by the OS. DW is destroyed but your yielded code is still running.



Thinks I do:

1. I manage system 'Power' messages.

2. I check if( IsValid( this )) after every yield() or yielding operation (like Retrieve with RetrieveRow event turned on).
  1. Helpful
  1. Aleš Vojáček
  2. Wednesday, 28 December 2022 17:31 PM UTC
I eddited original question with founded solution.

And did appologize all of you trying to help me out.

:-)

There is "functionality" wihich closes Response windows after 25 mins. I was not aware of that functionality and I have to dig into source code of that application.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 19 December 2022 15:11 PM UTC
  2. PowerBuilder
  3. # 3

you are probably running out of memory or resources depending on how you wrote your code.

is this 32 or 64 bit?  changing to 64 bit may be the fastest 'fix' since it is just a recompile vs having to refactor your code

add some manual memory release using GarbageCollect ( )

refactor  your code to make it use less memory 

 
Comment
  1. Aleš Vojáček
  2. Monday, 19 December 2022 19:18 PM UTC
Tomorow I will log to Seq server what I possible can inside this batch, so we will see, but I think that it just crash at some point. But we will see.
  1. Helpful
  1. mike S
  2. Monday, 19 December 2022 19:31 PM UTC
I'm talking about the PB debug mode for the PB run time debug log
  1. Helpful
  1. Aleš Vojáček
  2. Tuesday, 20 December 2022 13:16 PM UTC
I know, but this mode is really slow and the result is unreadable :-) I'm still waiting for time, when I will be able to run test :-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 19 December 2022 15:02 PM UTC
  2. PowerBuilder
  3. # 4

Hi Ales;

  Hopefully, your long running PB SS update App uses a DataStore approach. If so, did you create a custom PB.ini file with the following settings...

[DataStore Behavior]

UseHwnd=no 

Regards .... Chris 

Comment
  1. Aleš Vojáček
  2. Monday, 19 December 2022 17:16 PM UTC
That sounds good.

I thought about rewriting those checks to SQL procedure and use temporary table for store rows to check. And do all checks in DB, inform about progress in App.

But I was currious if there are some known issues which can cause crashing pbvm.dll So some minor changes could fix that problem instead of rewriting batch.

Thank you.
  1. Helpful
  1. Aleš Vojáček
  2. Monday, 19 December 2022 17:19 PM UTC
I tried to set SetRedraw on that datawindow to false before starting batch and this did not helped too. Yielding did not help, GC Collect did not helped. The memory is not the issue.

It is scary, that it just crash :-(

A.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 19 December 2022 18:37 PM UTC
Yes, a SP implementation on the WIP approach would be awesome as well. :-)
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Monday, 19 December 2022 13:30 PM UTC
  2. PowerBuilder
  3. # 5

Hi.

I would introduce some logging to see if crash happens always on the same row. If yes, I would try to see what may be the cause in that specific row. I would try to enter in debug mode and step into the code.

Andreas.

Comment
  1. Aleš Vojáček
  2. Monday, 19 December 2022 13:36 PM UTC
I will try, but it does not look like this problem is because of some row. It looks like it hapens after +/- 25 mins and there is not any error catchable in PB. Windows displays that application stoped working and that is all. :-(

A.
  1. Helpful
  1. Andreas Mykonios
  2. Monday, 19 December 2022 13:44 PM UTC
I agree. But with information provided until now I don't think you will get more specific help. 30.000 rows should not be a stopper. Of course we don't know row size. But I believe the issue should be hidden somewhere in the sql statements you execute (for checks).

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