1. Stephen BIppen
  2. PowerBuilder
  3. Wednesday, 20 November 2019 16:59 PM UTC

We have the following block of code, which has been working for many years but has recently stopped working.

// Instance declarations
n_rpt_callback inv_callback
n_rpt_shared inv_shared

...

// Start a separate thread
inv_callback = Create n_rpt_callback
inv_callback.iw_ReportWindow = this

// Create the shared object
ls_shareName = 'rpt_shared' + string(handle(this))
SharedObjectRegister('n_rpt_shared', ls_shareName)

// Success?
if SharedObjectGet(ls_shareName, inv_shared ) = Success! then
   // Post the event, run the report
   inv_shared.post of_RptRetrieveShared(<report data object here>,<database connection info here>,inv_callback)
end

...

It appears the posted function, of_RptRetreiveShare, no longer fires/executes.  This started about a month ago.

Any ideas?

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 21 November 2019 00:20 AM UTC
  2. PowerBuilder
  3. # Permalink

could it be that someone has added a global function to one of the attributes of a column or object in your datastore?

Comment
  1. Stephen BIppen
  2. Thursday, 21 November 2019 13:48 PM UTC
I thought the same, something changed. But I have scoured source control and there have been to no changes to the applicable objects.
  1. Helpful
  1. Stephen BIppen
  2. Friday, 22 November 2019 20:27 PM UTC
You were right Miguel. It was buried deep in the code, a change that was made to the application nearly three months ago. It was an added reference to an object in the main application that was of course not available in the new thread. I have no idea why it took so long for anyone to notice the problem. Thanks for your help.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 21 November 2019 15:02 PM UTC
  2. PowerBuilder
  3. # 1

Hi 

A few days ago I posted a sample app on https://community.appeon.com/index.php/qna/q-a/how-do-i-can-to-use-sqlca-with-threads-sharedobject

See if that works for you?

Regards 

Comment
  1. Stephen BIppen
  2. Thursday, 21 November 2019 16:26 PM UTC
Thanks Miguel. My next step was going to be to strip the functionally out of the application and create a stand alone application. Your code is very similar to what we have in the application. I will let you know what I learn.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 21 November 2019 16:28 PM UTC
great!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 21 November 2019 00:13 AM UTC
  2. PowerBuilder
  3. # 2

I don't know what "this" is in the following expression: 

ls_shareName = 'rpt_shared' + string(handle(this))

 

But could it be that it results in a null string somehow?

(just guessing)

Comment
  1. Stephen BIppen
  2. Thursday, 21 November 2019 13:59 PM UTC
Sorry. "this" is the calling window. I thought the same but SharedObjectGet(ls_shareName, inv_shared ) is returning Success!.



Since it is a separate thread there is no way for me to step through the code and debug. But I do have logging turned on in the application and there is nothing in the log for the function. There is information in the logs before and after the posted function but nothing from the function.
  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.