This strategy is valid for LockMode.PESSIMISTIC_WRITE This class is a clone of UpdateLockingStrategy.
| Modifier and Type | Field and Description |
|---|---|
| private final Lockable | |
| private final LockMode | |
| private static final Logger | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | PessimisticWriteUpdateLockingStrategy(Lockable
The metadata for the entity to be locked. lockable, LockMode Indictates the type of lock to be acquired. Note that
read-locks are not valid for this strategy. lockMode)Construct a locking strategy based on SQL UPDATE statements. |
| Modifier and Type | Method and Description |
|---|---|
| protected String | |
| protected LockMode | |
| public void | lock(Serializable
The id of the row to be locked id, Object The current version (or null if not versioned) version, Object The object logically being locked (currently not used) object, int timeout in milliseconds, 0 = no wait, -1 = wait indefinitely timeout, SessionImplementor The session from which the lock request originated session)Implements org. |
| lockable | back to summary |
|---|---|
| private final Lockable lockable | |
| lockMode | back to summary |
|---|---|
| private final LockMode lockMode | |
| log | back to summary |
|---|---|
| private static final Logger log | |
| sql | back to summary |
|---|---|
| private final String sql | |
| PessimisticWriteUpdateLockingStrategy | back to summary |
|---|---|
| public PessimisticWriteUpdateLockingStrategy(Lockable lockable, LockMode lockMode) Construct a locking strategy based on SQL UPDATE statements. | |
| generateLockString | back to summary |
|---|---|
| protected String generateLockString() | |
| getLockMode | back to summary |
|---|---|
| protected LockMode getLockMode() | |
| lock | back to summary |
|---|---|
| public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException Implements org. Doc from org. Acquire an appropriate type of lock on the underlying data that will endure until the end of the current transaction.
| |