Unable to access global variables such as dbdict, _ED, inside my custom script #740
-
Hi HammerDB Team, I'm running a custom script to run and I'm unable to access the global variables that are set according to the db configuration i.e. dbdict, bm, _ED. I've checked that these variables are available in vurun and in vucreate as well and in customscript proc. But once the VUs start running the script, I'm unable to access those variables inside the script. Is this behavior intentional? How can I access the global variables specifically configurations etc inside my custom script? Any guidance would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, that is correct and intentional. The Virtual Users are threads and can create and manage their own variables. If you want to share variables between threads you need to use thread shared variables https://www.tcl.tk/man/tcl8.6/ThreadCmd/tsv.htm, https://www.activestate.com/blog/threads-done-right-tcl/ |
Beta Was this translation helpful? Give feedback.
Yes, that is correct and intentional. The Virtual Users are threads and can create and manage their own variables. If you want to share variables between threads you need to use thread shared variables https://www.tcl.tk/man/tcl8.6/ThreadCmd/tsv.htm, https://www.activestate.com/blog/threads-done-right-tcl/