[TD71] TD-23879: Multiple template threads issue

Report bugs and possible workarounds.
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1083
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

[TD71] TD-23879: Multiple template threads issue

Post by Dave Rabelink » 31 May 2018, 06:00

TD-23879 (multiple forms)

I found an issue which can be reproduced using the attached sample application.

The sample consists of a main application source MyApplication.apt.
Also 2 apt files to create 2 separate dynalibs (dynalib1 and dynalib2)
There is just one thread class, situated in base.apl.

In this testcase I want to run one thread in dynalib1 and one in dynalib2 and also in the main application.



First see that the sample works:

1) Open MyApplication.apt and run it
2) In main form, enable the thread using the checkbox. You get a msgbox when thread starts. Progress is displayed
3) When thread is running, press button dynalib1
4) Dynalib1 form, enable the thread using the checkbox. You get a msgbox when thread starts. Progress is displayed
5) On main form, press button dynalib2
6) Dynalib2 form, enable the thread using the checkbox. You get a msgbox when thread starts. Progress is displayed

See that now 3 threads are running. No problem.


Testcase: multiple forms using the same template name breaks threading

The buttons dynalib1, dynalib2 and ExtraMain will create another instance of the forms. So multiple forms can be open at the same time.
Threads should work then, but they do not.

1) Press Extra main button to create another instance of the main form
2) Try starting the thread on the forms. They will not start. Even when closing one instance and leave the other open, the thread can not be started
3) Do the same for the dynalib1 and dynalib2 buttons. When multiple forms/dialogs of the same template is open, threads do not start.

You have to close all instances of the forms to get it working again.

Dynalib_Threads.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1083
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

[TD71] TD-23879: Multiple template threads issue

Post by Dave Rabelink » 01 Jun 2018, 06:09

Got response from OpenText Gupta
Defect to be scheduled for TD 7.2

"implement a SalBackgroundWorkerStartEx( ) to specify the background thread host window i.e. to get thread events etc. "

So, what does this defect mean.

You can not re-use the same form/dialog having threading implementation at the same time.

So for instance, if you create a form (lets say named frmProductList) which loads a list of products for a customer using a thread.
You can create only one instance of this form at the same time if you execute the thread.

This means that if you want to load the productlist for customer A and one list for customer B, by creating 2 forms and executing the threads will not work.
Only one form at the time can use the thread.

Solution in this particular case is to use the same thread class instances on one form which loads the product lists.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Harald
Germany
Posts: 11
Joined: 30 Mar 2017, 06:16
Location: Oberhaching/Munich, Germany

[TD71] TD-23879: Multiple template threads issue

Post by Harald » 01 Jun 2018, 08:18

TD 7.2? That means in two years ...
:(

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 0 guests