Can I just add:

Some people are in the habit of using domain scopes to hold frequent
variables, this is a great use for them. Typically, all your TAFs will
check to make sure that some variable exists and assume the rest are
there as well, ready to be used.

There are two problems with modification to these variables:

Scenario 1) At some point the underlying database is modified the domain
variables are simply cleared, thinking that the next execution will
reload them. This doesn't take into account that other threads may be
past the checkpoint but still expecting the variables to be available.
You should always reassign your variables in one step, rather than
purging and reassigning leaving a time gap of null information.

Scenario 2) Having many variables that critically must align. In some
cases more than one domain variable must be reassigned at the same time.
If the variable set is partially read from old data and partially read
from new data the result could be unwanted or dangerous. To work around
this, each time you setup your domain variables, name each with a
marker, then also, lastly, set that marker as the appropriate set to
use. Since the marker will be set once per thread, and used until
completion. Any one thread will either use old or new variables without
crossover.

Example logic:

assign domainvar_1 = "hello world"
assign use_set = 1

<@VAR domain$domainvar_<@VAR domain$use_set>> = "hello world"

assign domainvar_2 = "good bye world"
assign use_set = 2

<@VAR domain$domainvar_<@VAR domain$use_set>> = "good-bye world"

 (however, any thread that still has use_set = 1, still has retrieves
the expected value of "hello world")


Best

Robert Shubert
Tronics



> A few generalised rules:
> 
> 1   Where possible use request/local scoped variable. They are also
> faster.
> 2   Avoid counters and counter tests in shared scopes they are
> dangerous and tricky to trouble shoot
> 3   If you cannot avoid shared counters, code in a blocking mechanism
> to stop another tafs accessing the section of code with the shared
> variable.  Eg <@IF "!@@sharedscope$CodeSectionBlocked">Set Blocking
> Mechanism;Run Code;Reset blocking mechanism</@IF>.
>
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to