The lock accessor is used to place a named
resource into a transaction. When a resource is locked
the current request gains an exclusive lock on the resource which stops
other processes from gaining it until this transaction ends. A concurrent call
to lock will block indefinately until the
resource can be obtained.
lock can be used with <exception> handling blocks to create robust transactional
applications.