Introduction to Database Locks

Whether or not your Recordset objects can update, add, or delete rows depends on your database lock type. Most RDBMS implement various forms of table and row-level locking. Database locking prevents multiple users (or processes) from updating the same row at the same time. For example, suppose both my friend and I attempt to update the same row of information at the same time. Left to its own devices, this type of simultaneous updating could cause memory problems or data loss. To solve this, very smart RDBMS developers designed sophisticated software-locking techniques using a variety of algorithms.

Even though the locking dilemma has been solved and implemented for us, ADO developers still need to identify a valid locking mechanism such as read only, batch update, optimistic, or pessimistic. These types of locking mechanisms can be specified in the LockType property of the Recordset object. Table 9.2 describes available recordset lock types.

Table 9.2 LockType Property Values r

0 0

Post a comment