Thanks to all who replied. Generally I've only had to lock small blocks of code that would read SESSION vars. And of course, I would lock when setting them.
You're always helpful! Yves Arsenault Carrefour Infotech 5, Acadian Dr. Charlottetown, PEI C1C 1M2 [EMAIL PROTECTED] (902)368-1895 ext.242 ICQ #117650823 -----Original Message----- From: Thane Sherrington [mailto:[EMAIL PROTECTED]] Sent: February 6, 2003 2:28 PM To: CF-Talk Subject: Re: CF5 - More Locking (Sessions) At 02:25 PM 2/6/03 -0400, Yves Arsenault wrote: >How about something like this, ><cflock scope="SESSION" timeout="??" type="READONLY"> > <cfset User = "#SESSION.User#"> > <cfset SecurityLevel = "#SESSION.Security#"> ></cflock> > >How long should I lock this for? Depends how long you have to protect the transactions within the lock. If those transactions will take (worst case) 10 seconds, then I'd lock for 15. That gives a 50% margin of error. I try to do as little as possible within locks. So if I had to pull to pieces of data out of session vars, do a bunch of calculations to them, and then write the new values back to the session vars, I'd do it like this: <CFLOCK> Set non session variables to the value of the session variables. </CFLOCK> Do the work needed on these non-session variables. <CFLOCK> Write the data back to the session variables. </CFLOCK> The first lock would be readonly, the second exclusive. I'm basing this on what I understand from the gurus on this list, so I could be completely wrong. :) T ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

