Package org.hibernate
Interface Session.LockRequest
- Enclosing interface:
- Session
Deprecated.
A set of locking options attached
to the session.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.A timeout value indicating that the database should not wait at all to acquire a pessimistic lock which is not immediately available.static final intDeprecated.A timeout value indicating that attempting to acquire that there is no timeout for the lock acquisition. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Get the lock mode.default PessimisticLockScopeDeprecated.Obtain thePessimisticLockScope, which determines if locking extends to owned collections and associated entities.booleangetScope()Deprecated.usegetLockScope()intDeprecated.Get the timeout setting.voidDeprecated.Perform the requested locking.voidDeprecated.uselock(Object)setLockMode(LockMode lockMode) Deprecated.Specify theLockModeto be used.default Session.LockRequestsetLockScope(PessimisticLockScope scope) Deprecated.Set thePessimisticLockScope, which determines if locking extends to owned collections and associated entities.setScope(boolean scope) Deprecated.setTimeOut(int timeout) Deprecated.Specify the pessimistic lock timeout.
-
Field Details
-
PESSIMISTIC_NO_WAIT
static final int PESSIMISTIC_NO_WAITDeprecated.A timeout value indicating that the database should not wait at all to acquire a pessimistic lock which is not immediately available. This has the same effect asLockMode.UPGRADE_NOWAIT.- See Also:
-
PESSIMISTIC_WAIT_FOREVER
static final int PESSIMISTIC_WAIT_FOREVERDeprecated.A timeout value indicating that attempting to acquire that there is no timeout for the lock acquisition.- See Also:
-
-
Method Details
-
getLockMode
LockMode getLockMode()Deprecated.Get the lock mode.- Returns:
- the lock mode.
-
setLockMode
Deprecated.Specify theLockModeto be used. The default isLockMode.NONE.- Parameters:
lockMode- the lock mode to use for this request- Returns:
- this
LockRequestinstance for operation chaining.
-
getTimeOut
int getTimeOut()Deprecated.Get the timeout setting.- Returns:
- timeout in milliseconds, -1 for indefinite wait and 0 for no wait.
-
setTimeOut
Deprecated.Specify the pessimistic lock timeout. The default pessimistic lock behavior is to wait forever for the lock. Lock timeout support is not available in everydialectof SQL.- Parameters:
timeout- is time in milliseconds to wait for lock. -1 means wait forever and 0 means no wait.- Returns:
- this
LockRequestinstance for operation chaining.
-
getScope
Deprecated.usegetLockScope()Check if locking extends to owned collections and associated entities.- Returns:
- true if locking will be extended to owned collections and associated entities
-
getLockScope
Deprecated.Obtain thePessimisticLockScope, which determines if locking extends to owned collections and associated entities. -
setScope
Deprecated.Specify whether theLockModeshould extend to owned collections and associated entities. An association must be mapped withCascadeType.LOCKfor this setting to have any effect.- Parameters:
scope-trueto cascade locks;falseto not.- Returns:
this, for method chaining
-
setLockScope
Deprecated.Set thePessimisticLockScope, which determines if locking extends to owned collections and associated entities. -
lock
Deprecated.uselock(Object)Perform the requested locking.- Parameters:
entityName- the name of the entity to lockobject- the instance of the entity to lock
-
lock
Deprecated.Perform the requested locking.- Parameters:
object- the instance of the entity to lock
-
LockOptionsand pass it toSession.lock(Object, LockOptions).