通常Web应用程序有页锁和行锁。
行锁定,具有到表锁的升级。
上述比较表明,使用表锁而不是行锁可以节省大约3%的耗时。
The above comparison shows that causing table locks to be used instead of row locks saved about 3% in elapsed time.
g代表“granted”,意即事务句柄为2的事务拥有行锁。
G stands for "granted" and means that the transaction with transaction handle 2 owns the row lock.
利用分配给DB 2服务器的内存,DB 2无法维护大量的行锁。
DB2 was unable to maintain a large number of row locks with the memory allocated to the DB2 server.
由于我们没有操控锁,因此引擎在需要一行(或者页)时会对其进行锁定。
Since we are not manipulating locks ourselves, the engine is locking each row (or page) as it needs it.
通过使用这种方法,在对行执行选择、更新或删除操作期间,不会持有行锁。
With this approach, no locks are held between selecting and updating, or deleting a row.
如果用一个表锁替换这些行锁,将不再会超出maxlocks值,那么锁升级就会停止。
If after replacing these with a single table lock, the MAXLOCKS value is no longer exceeded, lock escalation stops.
数据库管理器通过查看应用程序的锁列表并查找行锁最多的表,来决定对哪些锁进行升级。
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.
在目标页中对该行进行格式化,并获得该行上的一个X(exclusive,独占的)行锁。
The row is formatted in the target page and an X (exclusive) row lock is obtained on it.
锁维护空间不足可能会导致所谓的“锁提升”,其中,行锁被提升为不必要的表锁,这甚至可能会导致死锁情况。
Shortages in the lock maintenance space can lead to so-called lock escalations, in which row locks are escalated to undesirable table locks, which can even lead to deadlock situations.
如果一个并发连接的应用程序碰巧持有不兼容的行锁,那么import工具就会暂停,直到该应用程序提交或回滚其事务。
If a concurrently connected application happens to be holding an incompatible row lock, the import utility pauses until that application commits or rolls back its transaction.
对于mdc表,选择BLOCKINSERT可以提高INSERT操作的性能,因为使用的是块级的锁,避免了为INSERT操作使用行锁。
For MDC tables, the selection of BLOCKINSERT may improve the performance of INSERT operations by locking at the block level and avoiding row locks for INSERT operations.
红色的行是偏向锁被激活的地方。
The line annotated in red is where biased locking is enabled.
IDS允许应用程序开发人员将锁放在不同的对象上,如数据库、表、页或行、以及索引。
IDS allows application developers to place locks on different objects, like databases, tables, pages or rows, and indexes.
在子线程中,打开新的DB 2连接,在锁表中获取具有所请求的资源ID的一行。
Within the child thread, open a new connection to DB2 and fetch a row from the lock table for the requested resource ID.
由于数据库管理器能够确定某一行何时会被修改,因此可以保证数据完整性,同时限制持有锁的时间。
Because the database manager can determine when a row is changed, it can ensure data integrity while limiting the time that locks are held.
在导出操作期间,行级别锁定应用于导出表(exportingtable),这意味着一次只持有一个锁。
During an export operation, row-level locking is applied to the exporting table, which means that only one lock is held at a time.
即使另一个并发会话持有一个独占式行级锁,它仍然返回最近提交的行。
It returns the most recently committed version of the rows, even if another concurrent session holds an exclusive row-level lock.
如果在此事务中发出一个新查询,将显示新行,因为事务持有新行的锁。
If you issue a new query within this transaction, your new row is displayed, because your transaction holds the lock for the new row.
数据行只是在游标定位它们时才锁定,一旦获取下一行之后,锁将被解除。
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.
在第一个会话中,执行清单16中的update语句,它对部门号为B01的部门行设置独占锁。
In the first session, execute the UPDATE statement shown in Listing 16, which places an exclusive lock on the row with department number B01.
同时,事务2希望访问这个行,但是它必须等待事务1释放该行的锁。
In the meantime, transaction 2 wants access to that same row, but it has to wait until the lock is released by transaction 1.
并且由于每一行都被存储在固定的位置,使得锁升级这样的技术得以实现,以避免过多细粒度锁。
And the location of every row is in a fixed location, allowing for techniques such as lock escalation when too many fine-grained locks would otherwise be needed.
如果锁表中有重复的行(参见为资源锁定创建一个DB 2表一节),就可以对资源进行并发使用。
When having duplicate rows in the lock table (see the Create a DB2 table for resource locking section), concurrent use of the resource is possible.
乐观事务锁不能用于在单个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.
对于每个新行之上的锁,惟一可以替代的是表锁(DB 2中没有页锁)。
The only alternative to a lock on every new row is a table lock (since there are no page locks in DB2).
减少锁管理器的hash表中对行和表锁的虚假锁竞争。
Reduction in false lock contentions for row and table locks in the lock manager's hash table
输出表明等待的是db2pd 输出中的行(0;A)上的锁,因为提供锁请求状态的 ‘Sts’列显示W,表示等待。
The output indicates that you are waiting on the lock on the row (0;A) from the db2pd output because the 'Sts' column, which provides the status of the lock request, shows a W for waiting.
因此,会释放这一行的DB2更新锁,清单2中的下一个SQLselect语句会看到这一行。
As a result, the DB2 update lock for the row is released and this row is found by the next SQL select statement in Listing 2.
应用推荐