The appropriate use of locks can be really important. Here's a case in point that cost me a LOT:
I did an application for a client where to save processing time, I put a couple of variables used many times into the application scope. In this case I wasnt allowed to deploy the application to the production server myself, their staff programmer was going to do it. I had to write the code, demonstrate, test it and prove it on a dev server, then give them the code to deploy on production. Nothing too unusual there. Except the person who did the deployment to production didnt listen to what I told him, didn't read my installation notes, and didnt know much about modern ColdFusion. His knowledge was based back in CF5. He looked at my code, scoffed at all my unlocked reads of application variables and "corrected" it by putting locks around every access of application vars. In this application that was about 50 places in 5 files. For good measure he put locks on every datasource access as well. When 400 users started using this application (it was something they all access many times a day) all these locks brought the entire system to its knees. Instead of doing what normal people would do and calling me to tell me to come and sort out the problem, they decided that my code had brought their system to its knees, they dumped my application and set their staff guy to re-writing what I'd done and told me i wasnt needed any more. If they'd have called me, I'd have been there in 30 minutes, looked at the changes their staff guy had made, fixed them, and it would have been up and rolling inside an hour. Sadly, I wasn't given the opportunity to have a say, or correct what they had already decided was my mistake. My point here is that locks, if used incorrectly, can wreck an application, or as in this case bring an entire server and database to a crawl. Cheers Mike Kear Windsor, NSW, Australia Adobe Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month p.s. when I last heard, they were still putting locks around every application scope and database access, and had decided that ColdFusion ran too slow, so they were re-writing their whole system in dotnet instead. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334216 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm