Abstract base class for entity persisters that support locking.
Modifiers | Name | Description |
---|---|---|
static int |
DEFAULT_TIMEOUT |
Fields inherited from class | Fields |
---|---|
class EntityPersister |
proxyFactory, publisher, session |
Constructor and description |
---|
LockableEntityPersister
(MappingContext mappingContext, PersistentEntity entity, Session session, org.springframework.context.ApplicationEventPublisher publisher) |
Type | Name and description |
---|---|
boolean |
isLocked(java.lang.Object o) Return whether an object is locked or not |
java.lang.Object |
lock(java.io.Serializable id) Locks an object for the given identifier returning the locked instance |
java.lang.Object |
lock(java.io.Serializable id, int timeout) Acquire a lock using the given identifier and timeout delay |
java.lang.Object |
proxy(java.io.Serializable key) |
void |
unlock(java.lang.Object o) Unlocks a locked object |
Methods inherited from class | Name |
---|---|
class EntityPersister |
cancelInsert, cancelUpdate, createEntityAccess, delete, delete, deleteEntities, deleteEntity, firePostDeleteEvent, firePostInsertEvent, firePostUpdateEvent, getMappingContext, getObjectIdentifier, getPersistentEntity, getProxyFactory, getSession, getType, incrementVersion, isVersioned, newEntityInstance, persist, persist, persistEntities, persistEntity, proxy, retrieve, retrieveAll, retrieveAll, retrieveAllEntities, retrieveAllEntities, retrieveEntity, setDateVersion, setObjectIdentifier, setVersion |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Return whether an object is locked or not
o
- The objectLocks an object for the given identifier returning the locked instance
id
- The identifierAcquire a lock using the given identifier and timeout delay
id
- the identifiertimeout
- the amount of time to wait before giving up in secondsUnlocks a locked object
o
- The object to unlock