Locking / Lock Recommendations
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
I thought it valuable for you to have some recommendations with regards to locking, so I have a little list here that you can follow. Look over your code to determine if locking should be done, especially if you're using an application or session-scope variable. Consider using a lock when you need to write to a variable. Minimize locking however. It does slow down performance. Only add a lock if the data could be affected by multi-threading. Multiple-page requests, trying to change the value at the exact same time. Don't put queries or other time-consuming code into a lock. If you do, you will find that your code and your performance is drastically undermined, so that is something to avoid. Use named locks instead of scope locks as much as you can. Just be cautious in naming your locks. Make sure you add the application name to a named lock so that multiple applications on the same server don't end up locking accidentally. Also, it is something to keep in mind that you can end up using the same name within your application for a lock and those two would end up waiting for one another, so just be cautious when you're using a named lock. And do not nest locks. The Adobe recommendation is that you do not nest locks. You may read books otherwise, but that is the preferred standard. You can run into a deadlock if you accidentally nest your locks in the wrong manner. One lock is waiting for the other to release, the other is waiting for this one to release and you get what's called a deadlock and your entire code freezes up. So that is not a situation you want to be in, so do not nest locks. And we'll be using locks coming up later in the course, so as you can see, we didn't really get into the code and type it out and all of that. We'll be doing that coming up. I just wanted to give you a good basis for locks and the information involved in them right now so that later when I'm using them, I don't have to go through all these explanations.
Tutorial Information
| Course: | ColdFusion MX 7 Advanced |
| Author: | Candyce Mairs |
| SKU: | 33828 |
| ISBN: | 1-934743-34-8 |
| Release Date: | 2007-11-30 |
| Duration: | 6 hrs / 89 lessons |
| Work Files: |
Yes |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 