由于数据库管理器能够确定某一行何时会被修改,因此可以保证数据完整性,同时限制持有锁的时间。
Because the database manager can determine when a row is changed, it can ensure data integrity while limiting the time that locks are held.
数据库管理器通过查看应用程序的锁列表并查找行锁最多的表,来决定对哪些锁进行升级。
The database manager determines which locks to escalate by looking through the lock list for the application and finding the table with the most row locks.
IDS允许应用程序开发人员将锁放在不同的对象上,如数据库、表、页或行、以及索引。
IDS allows application developers to place locks on different objects, like databases, tables, pages or rows, and indexes.
乐观事务锁不能用于在单个update语句中更新数据行集合,因此在这种情况下,很难进行错误处理。
Optimistic transaction locking should not be used to update sets of rows in a single update statement, as error handling in this case is very difficult.
数据行只是在游标定位它们时才锁定,一旦获取下一行之后,锁将被解除。
Rows are only locked at the point in time that a cursor is positioned on them; once the next row is fetched, the lock is released.
一些数据库(比如sqlServer)允许您禁用页面级锁,以期它不会从行级锁切换到表级锁。
Some databases (such as SQL Server) allow you to disable the page-level locking in hopes that it won't escalate from a row-level lock to a table-level lock.
现在,我们开启会话2也更新订单表,不同的是更新的数据行为Id=2,同样的在数据行Id=2上也会申请排它锁至到更新事务的结束。
Now let's start session 2 and have it update another row in the Orders table. Same situation – session acquires and holds X lock on the row with (ID = 2).
数据库引擎将选择相应的锁,并且可以将锁从行锁或页锁升级到表锁。
The Database Engine chooses the appropriate lock and can escalate the lock from a row or page lock to a table lock.
传统的数据库一般地在从日志表中生成摘要表这方面的表现不怎么好,因为在这种情况下,行记录锁几乎没用。
Transactional database systems in general are not very good at generating summary tables from log tables, because in this case row locking is almost useless.
传统的数据库一般地在从日志表中生成摘要表这方面的表现不怎么好,因为在这种情况下,行记录锁几乎没用。
Transactional database systems in general are not very good at generating summary tables from log tables, because in this case row locking is almost useless.
应用推荐