Figure 1 shows the idea behind pessimistic locking.
图1展示了悲观锁定背后的思想。
Figure 1 illustrates the functioning of pessimistic locking.
图1阐释了悲观锁定的功效。
Pessimistic locking, where a record is locked while it is edited.
悲观的锁定,在编辑记录时将其锁定。
Fixed for UPDATE statements not generated for pessimistic locking.
修复了不会生成悲观锁定的FOR UPDATE语句。
Certain critical updates should always be done with pessimistic locking.
进行特定的关键性更新时,应始终使用悲观锁定方式。
The main problem with a pessimistic locking approach is that transactions have to wait for each other.
悲观锁定方法的主要问题是事务之间必须互相等待。
The advantage of pessimistic locking is that it is guaranteed that changes are made consistently and safely.
悲观锁定的优点就是能够保证实现一致且安全的更改。
However, this should be evaluated on a case by case basis — there are situations where pessimistic locking is necessary.
但是,在实际使用中应根据具体情况进行分析,有时也需要悲观锁定方案。
Avoid pessimistic Locking since the pessimistic locks affect the throughput and it's difficult to recover from bad locks.
应当尽量避免使用悲观锁,因为它会影响吞吐量,而且很难从坏锁(badlocks)中恢复。
A pessimistic locking strategy assumes that the probability is high that another user will try to modify the same row in a table that you are changing.
悲观锁定策略的前提是,另一个用户很可能试图修改您正在修改的某个表行。
However, for entity beans this rule has to be relaxed; due to the nature of the model, most pessimistic locking access intents require at least Repeatable Read.
但是,对于实体Bean则可不遵循此规则,由于该模型本身的特性,多数悲观锁定访问都需要至少RepeatableRead。
In the pessimistic locking scheme, explicit locks are taken against rows using the SQL SELECT FOR UPDATE statement. Data is then modified, and an SQL UPDATE is issued.
在悲观锁定方案中,通过使用SQLSELECTFORupdate语句对数据行进行显式锁定,然后更改数据,并执行SQL UPDATE。
Pessimistic session locking is a form of serialization and can severely limit system availability, and so should be used with caution.
悲观会话锁定是一种序列化形式,会严重地影响系统的可用性,须小心使用。
Pessimistic session locking should be used with great discretion, as it serializes access to data across a business process that includes user think time.
必须谨慎使用悲观会话锁定,因为它在业务流程(包括用户思考时间)中序列化数据访问。
If pessimistic session locking is used, it should generally only be used to block other users from updating; it should not block reads of the locked data.
如果使用悲观会话锁定,它通常只用于阻止其他用户进行更新,而不是阻止对锁定数据的读取。
As will be discussed later, pessimistic session locking has several problematic situations that need to be addressed, such as the cleaning up of abandoned locks.
在使用悲观会话锁定中需要注意一些问题,例如清理废弃的锁等,这将在稍后进行介绍。
Pessimistic record locking, which provides a way to prevent situations where multiple users can edit a record at the same time.
消极记录锁定,它提供了避免发生多个用户同时编辑一条记录情况的手段。
While that JVM was pessimistic and exclusive in its locking semantic, we could support so much more out in the cluster where coordination was implemented in Terracotta.
由于JVM的锁语义是悲观和排他的,因此当把协调关系放到Terracotta中实现,我们就能够在集群中提供更多的支持。
The pattern in this case is that when the first transaction reads a row it will "stamp" it with the identity of the user, similarly to how pessimistic session locking is handled (covered next).
本例中的模式是当第一个事务读取某个数据行时,它将加上时间戳和用户标识,这类似于悲观会话锁定的处理方式(稍后讨论)。
The pattern in this case is that when the first transaction reads a row it will "stamp" it with the identity of the user, similarly to how pessimistic session locking is handled (covered next).
本例中的模式是当第一个事务读取某个数据行时,它将加上时间戳和用户标识,这类似于悲观会话锁定的处理方式(稍后讨论)。
应用推荐