public class OptimisticLockModeEvent extends ManagedEntityEvent
OptimisticLockModeEvent indicates that a managed entity was locked using the
LockModeType.OPTIMISTIC mode without having the associated database record locked with the
LockModeType.PESSIMISTIC_READ or LockModeType.PESSIMISTIC_WRITE
strategy.
Without locking the underlying record, there's a window of opportunity between the
version check and the transition commit, in which time the entity could still be changed by a concurrent transaction,
therefore defeating the purpose of this optimistic locking mechanism.
Ideally, the LockModeType.PESSIMISTIC_READ or
LockModeType.PESSIMISTIC_WRITE should be acquired right before
exiting the service method that triggers the transaction commit.Event.Priority| Constructor and Description |
|---|
OptimisticLockModeEvent(Class entityClass,
Object entityIdentifier) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
|
Event.Priority |
getPriority()
Get the
Event.Priority of this Event |
getEntityClass, getEntityIdentifier, getEntityNamegetInfoUrlpublic Event.Priority getPriority()
Event.Priority of this EventEvent.Priority of this EventCopyright © 2026. All rights reserved.