The project lock would be used at a higher hierarchical level than the Lock object that you might use for general purpose locking within a session.
It is even more important that you don't hog a lock on the project object as this can cause severe performance problems.
The lock will stall if another script currently has a lock extant on this project. The method will then return when that lock is relinquished.
If you are accessing files for writing in a server-side application (within NES), you should make sure the project locking is activated to avoid file corruption happening if there are multiple simultaneous accesses to the file.
<SERVER> // An example file access with project level locking to prevent // file corruption. project.lock(); myFileObject.open("a"); myFileObject.writeln("Append this line to the file."); myFileObject.close(); project.unlock(); </SERVER>
See also: | File.open(), server.lock() |
Prev | Home | Next |
project object | Up | project.unlock() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |