1. James Hsu
  2. PowerBuilder
  3. Tuesday, 16 February 2021 02:46 AM UTC

We have a PowerBuilder application we are trying to migrate from 11.5 to 2019 R2, and so far it was going great, until we were testing a module that calls a stored procedure and crashes at the CLOSE of the sproc with the message "Appeon PowerBuilder 2019 R2 has stopped working", and force quits the application (including PB if run with debug).

We've tried to pinpoint the issue by doing the following:

1. Replace the stored procedure being called with a dummy proc that does not do anything but still creating a result set.  In this case, the application still crashes at the CLOSE of sproc.  The content of the proc doesn't seem to matter here.

2. Replace the stored procedure being called with a dummy proc with no result set, comment out the "CLOSE" of that proc since stored proc with no result set does not require a CLOSE.  In this case, the app crashes right after execution of the stored procedure.

3. Comment out the stored procedure call.  We tried to see if commenting the stored procedure would allow the application to keep going without crashing.   In this case, it'll go past the line where the app crashed previously, but upon coming to a point where another stored procedure is called, the app crashed on CLOSE of that subsequent stored procedure.  This lead us to believe that there is a point where the app became unstable before the stored procedure was called, and crashes upon a call of a stored procedure.

4. Using autocommit = true before the proc is called, and comment out the COMMIT.  Doing this made no changes in terms of preventing application crash, the application still crashed at the point where CLOSE of the stored procedure was called.  

Does anyone have any clue on what causes the application crash?  What this module does is basically save a transaction to a transaction table using update(), which works fine, then subsequently calls a stored procedure to save the transaction details to a transaction table detail after doing some calculations on a "save" event.  Before the save is called, we have other modules calling and running other stored procedures without any issues repeatedly.  We are using PowerBuilder 2019 R2 Build 2353.  We are running out of ideas and approaching deadline rapidly.  Any suggestions or advise will be greatly appreciated.

EDIT: Here are more details:

1. We are using Microsoft SQL Server 2014 (SP3-CU4) (KB4500181) - 12.0.6329.1 (X64) 

2. We are using ODB ODBC, with ODBC Driver 11 for SQL Server

3. We are running the stored procs through PowerScript (inline SQL?) with the following syntax:

DECLARE sp_proc_name PROCEDURE FOR dbo.proc_name

@param1 = :param1,

@param2 = :param2;

EXECUTE sp_proc_name;

<check SQL status code>

CLOSE sp_proc_name;

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 16 February 2021 08:15 AM UTC
  2. PowerBuilder
  3. # Permalink

Which dbparm parameters do you use for the transaction object? Is PBNewSPInvocation present?

See this link: https://docs.appeon.com/pb2019r2/connecting_to_your_database/ch16s19.html

regards

Comment
  1. Chris Pollach @Appeon
  2. Friday, 19 February 2021 23:49 PM UTC
Should be ... PBNewSPInvocation='YES'

No is the default
  1. Helpful
  1. James Hsu
  2. Monday, 22 February 2021 19:19 PM UTC
Hi Miguel and Chris,



I tried setting it to Yes and it appears to be no longer crashing! Thanks a bunch.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 22 February 2021 19:43 PM UTC
That is "awesome" news James! :-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 16 February 2021 03:07 AM UTC
  2. PowerBuilder
  3. # 1

Hi James;

   Can you tell us ...

1) What DBMS & version are you using.

2) What DB Client is your App using to connect?

3) How are you calling the SP (ie SP DataWindow, inline SQL or RPC)?

Regards ... Chris

Comment
  1. Miguel Leeuwe
  2. Saturday, 20 February 2021 00:02 AM UTC
I'm sorry maybe I don't understand, but in my opinion, you don't have to change anything if you change the setting to 'Yes'. Correct me if I'm wrong.
  1. Helpful
  1. Olan Knight
  2. Saturday, 20 February 2021 02:47 AM UTC
Miguel is correct: you are changing the transaction object SQLCA.DBPARM parameter to include the new option. Unless you have a more than a few transaction objects, this should be an easy change.



It's even esier if you have a parent transaction object that is not overridden! :)
  1. Helpful
  1. James Hsu
  2. Monday, 22 February 2021 19:19 PM UTC
It look like setting the PBNewSPInvocation to Yes solved the issue, or at least where it was crashing from my preliminary testing. Thank you all!
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.