Dynamic Locking

Overview of Dynamic Locking

Dynamic locking is an SPD Server feature that gives multiple users concurrent access to SPD Server tables. Multiple users can perform read and write functions (insert, append, delete, and update), and the integrity of the table contents is preserved.
Dynamic locking is enabled or disabled at the domain level. All tables that are stored within the domain are subject to the setting of the dynamic locking feature. The DYNLOCK= statement should be used in libnames.parm file domain declarations.
Dynamic locking is different from SPD Server record-level locking. Clients that use dynamic locking connect to a separate SPD user proxy process for each LIBNAME connection in the domain. In SPD Server record-level locking, all clients share the same record-level locking proxy process.

Benefits of Using Dynamic Locking

SPD Server uses the dynamic locking feature to alleviate some of the problems and limitations that occur with record-level locking. The dynamic locking method of using separate proxy processes instead of a single record-level proxy distributes resource allocations, which decreases the probability of a single proxy process reaching resource limits. Dynamic locking also removes a single record-level locking point of failure for the record-level proxy. If there is a failure in an SPD Server user proxy when dynamic locking is being used, only the client that is connected to that proxy is affected. If there is a failure in an SPD Server record-level proxy, then all client connections are affected.
Dynamic locking can also provide better performance than record-level locking. Dynamic locking has performance advantages over record-level locking when concurrent READ and WRITE access to a table is required. This advantage is due to the more distributed processing and parallelism of that occurs when multiple SPD Server user proxies are used. The performance benefit depends on the opportunities for parallelism, and you should quantify the benefit on a case-by-case basis.

How Dynamic Locking Works

To use dynamic locking, SPD Server tables must be part of a named SPD Server domain. When dynamic locking is enabled for a domain, all of the SPD Server users that access tables in that domain automatically use dynamic locking. The SPD Server clients do not need to set any additional parameters to take advantage of the benefits of dynamic locking.
When SPD Server proxy processes receive concurrent update, append, insert, and delete commands, the commands are sequentially queued and then executed in order of arrival. Only one Update operation is performed on a table at any one time. Read requests can be executed at any point during an Update operation. Read requests get the most recent information that is available in the table, based on the last physical update to disk.
Dynamic locking is not a replacement for using record-level locking when the user requires SAS record-level integrity across multiple clients. Reading a record using dynamic locking does not guarantee that the record will not change before a subsequent read or update is executed. If a client needs a true record-level lock, then the record-level locking protocol should be used.
Note: A domain that has dynamic locking enabled cannot also use record-level locking.