1. Mario Francisco Celleri
  2. PowerBuilder
  3. Monday, 27 February 2023 18:38 PM UTC
Hi guys.

There is a way to read several dw at the same time in timer's event window?. Each dw have different number of records (different data); so each dw must read regardless of what the others do. Is there a way to do it?
When a record is read, it is processed by a different application to which it is sent parameters.

Have you a code example, to show me how can I do?


Thanks and regards.
 
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 28 February 2023 01:25 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

Sounds like you want to do things asynchroneously. Shared objects are the best way of doing this, though you could also do async retrieval of you datastores, but I've learned it's not as reliable.

Have a look at this link where you can find some link(s) also for examples: https://community.appeon.com/index.php/qna/q-a/multithreading-example-in-powerbuilder-2017-r3?limitstart=0#reply-33427

regards.

Comment
There are no comments made yet.
Mario Francisco Celleri Accepted Answer Pending Moderation
  1. Monday, 27 February 2023 23:12 PM UTC
  2. PowerBuilder
  3. # 2

Hi Cris;

 

Have you a example code. I'm very new in PB.

 

thanks and regards.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 28 February 2023 15:13 PM UTC
Hi Mario;

Basically ...



DataStore DS1, DS2, ...

DS1 = Create DataStore

DS2 = Create DataStore // More as required

DS1.DataObject = "DWO1"

DS2.DataObject = "DWO2" // More as required

DS1.SetTransObject (SQLCA)

DS2.SetTransObject (SQLCA) // More as required

DS1.Retrieve()

DS2.Retrieve() // More as required

// process DS's data buffer as required

Destroy DS1

Destroy DS2 // More as required



HTH

Regards ... Chris

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 27 February 2023 18:47 PM UTC
  2. PowerBuilder
  3. # 3

Hi Mario;

   The simplest way is to use a DataStore for each DWO in the Timer Event. Then perform a Retrieve() on each DS that you need to have a DB Select performed. Then process each DS's primary buffer data as required.  HTH

Regards ... Chris 

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