> I have an Application variable with info about the database
> (DSNName, UserName etc). The variable is a struct and some
> of the keys are structs themselfs. When i talk to the databse
> i use a set of CustomTags, to witch i send the Application
> varibel as an attribute.
>
> For example
>
> <CF_getUserInfo
> UserID="343"
> stDatabase="#Application.stDatabase#">
>
> Do i have to lock the call to the CustomTag ?
Yes, you must. In your example, by referencing Application.stDatabase,
you're passing it by reference to the custom tag, meaning that the custom
tag, when it references any of the values Attributes.stDatabase contains,
will be referencing the Application structure itself - and in fact, the
custom tag could write to the Application scope by referencing
Attributes.stDatabase, so you may need to place an exclusive lock.
If you wanted to avoid placing an exclusive lock, you could get away with
using a readonly lock by doing this:
<CF_GetUserInfo
UserID="343"
stDatabase="#Duplicate(Application.stDatabase)#">
Of course, if you knew that the custom tag doesn't modify the contents of
Application.stDatabase, you could use a readonly lock.
If you wanted to avoid placing any lock at all on the custom tag, you could
do this:
<CFSET stLocalDatabase = Duplicate(Application.stDatabase)>
<CF_GetUserInfo
UserID="343"
stDatabase="#Variables.stLocalDatabase#">
If you wanted to avoid locking the custom tag, and didn't want to duplicate
the stDatabase structure, you could reference the individual members of the
structure from within the custom tag, and lock those references. Your custom
tag would then have to refer to the data directly from within the
Application scope, rather than have it passed in as an attribute.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.