- Christopher Craft
- PowerBuilder
- Tuesday, 16 May 2017 11:21 PM UTC
PB 12.5.1
I know that global variables are not shared across threaded objects but is it safe to create a new instance and set the global variable to that in the threaded object (ie. SQLCA)? My situation is this - I create multiple threads (sharedobjects) that connect to the database to do certain work. Any newly created thread will create there own transaction object and connect to the database. I am now enhancing this so the threads can process other NVO service objects but those objects use the global transaction object to do their work. I started to go down the path of creating an instance transaction variable for these service objects and then I just set it to the threads transaction object. This works fine until these service objects use other service objects and then it starts to get a little messy. If it is supported to set the global transaction object in the thread then all my other NVO service objects will just work without change.
Thanks for your thoughts,
Chris Craft
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.