On 5/15/02, Rob Baxter penned:
>You need to use the name attribute to specify a name unique to that locking
>code. For example, for Session var locking I usually used <cflock
>name="#CFID#_#CFTOKEN#" ...>

I don't think that's going to work as user A will have a different 
cfid and cftoken than user B. This will allow them to both access the 
same exclusive lock simultaneously since they'll be named differently.

I generally use the datasource name since I know it's unique to the 
server and append something for each different variable.

<cfset request.dsn = "mydatasource">

To set  a value in a variable named session.cart:
<cflock name="#request.dsn#_basket" timeout="10" type="exclusive">
<cfset session.cart.product_id = #form.product_id#">
</cflock>

To read session.cart:
<cflock name="#request.dsn#_basket" timeout="10" type="readonly">
</cfoutput>#session.cart.product_id#</cfoutput>
</cflock>
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to