A file locking method and implementation are disclosed which allows a
plurality of user sessions to open and read a file, but at any one time,
only one session will be allowed to change the data displayed in the
browser window and to update the file. This file locking method sets up a
file access priority by using file locks that are date-time stamped and
session stamped. The types of lock associated with the present invention
include read lock, authority lock, write lock, and folder lock. When a
session/user requests access to a file, the application will check a lock
table associated with the requested file. For each lock on the file,
there is an entry in the lock table for each of the attributes of the
lock: lock type, session owner, date-time stamp. Depending on the lock
and the existing locks on the file, the requesting session may be granted
a lock. After the access request is fulfilled, the file lock may be
removed. When a session expires, all the locks owned by this session will
be invalidated and removed.