ObjectDB Database Search
1-50 of 50 resultsjakarta.persistence.LockModeType
Jakarta Persistence (JPA) Enum jakarta.persistence. LockModeType java.lang.Object ∟ java.lang.Enum ∟ jakarta.persistence. LockModeType Implemented Interfaces: FindOption , RefreshOption , Constable ... which may be obtained on an entity instance. A specific lock mode may be requested by passing an explicit LockModeType
|
|
jakarta.persistence.LockModeType.LockModeType()
Jakarta Persistence (JPA) Constructor in jakarta.persistence. LockModeType LockModeType () Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.LockModeType.READ
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType READ Synonymous with LockModeType .OPTIMISTIC . OPTIMISTIC is preferred for new applications. Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.LockModeType.WRITE
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType WRITE Synonymous with LockModeType .OPTIMISTIC_FORCE_INCREMENT . OPTIMISTIC_FORCE_INCREMENT is preferred for new applications. Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.EntityManager.refresh(Object,LockModeType)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void refresh ( Object entity , LockModeType lockMode ) Refresh the state of the given managed entity ... when there is no transaction and a lock mode other than LockModeType .NONE was specified; or if invoked
|
|
jakarta.persistence.EntityManager.refresh(Object,LockModeType,Map)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void refresh ( Object entity , LockModeType lockMode , Map properties ) Refresh the state ... when there is no transaction and a lock mode other than LockModeType .NONE was specified; or if invoked
|
|
jakarta.persistence.TypedQuery.setLockMode(LockModeType)
Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setLockMode ( LockModeType lockMode ) Set the lock mode type to be used for the query execution. Parameters: lockMode - lock mode Returns: the same query instance. Throws: IllegalStateException
|
|
jakarta.persistence.LockModeType.OPTIMISTIC
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType OPTIMISTIC Optimistic lock. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.LockModeType.OPTIMISTIC_FORCE_INCREMENT
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType OPTIMISTIC_FORCE_INCREMENT Optimistic lock, with version update. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.LockModeType.PESSIMISTIC_READ
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType PESSIMISTIC_READ Pessimistic read lock. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.LockModeType.PESSIMISTIC_WRITE
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType PESSIMISTIC_WRITE Pessimistic write lock. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.LockModeType.PESSIMISTIC_FORCE_INCREMENT
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType PESSIMISTIC_FORCE_INCREMENT Pessimistic write lock, with version update. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.LockModeType.NONE
Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. LockModeType NONE No lock. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.EntityManager.lock(Object,LockModeType,LockOption...)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void lock ( Object entity , LockModeType lockMode , LockOption... options ) Lock an entity instance belonging to the persistence context, obtaining the specified lock mode , using
|
|
jakarta.persistence.EntityManager.lock(Object,LockModeType)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void lock ( Object entity , LockModeType lockMode ) Lock an entity instance belonging to the persistence context, obtaining the specified lock mode . If a pessimistic lock mode type is specified
|
|
jakarta.persistence.EntityManager.lock(Object,LockModeType,Map)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void lock ( Object entity , LockModeType lockMode , Map properties ) Lock an entity instance belonging to the persistence context, obtaining the specified lock mode , using the specified
|
|
jakarta.persistence.EntityManager.find(Class,Object,LockModeType)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager T find ( Class entityClass , Object primaryKey , LockModeType lockMode ) Find by primary key and obtain the given lock type for the resulting entity. Search for an entity of the specified
|
|
jakarta.persistence.EntityManager.find(Class,Object,LockModeType,Map)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager T find ( Class entityClass , Object primaryKey , LockModeType lockMode , Map properties ) Find by primary key and lock the entity, using the specified properties. Search
|
|
jakarta.persistence.Query.setLockMode(LockModeType)
Jakarta Persistence (JPA) Method in jakarta.persistence.Query Query setLockMode ( LockModeType lockMode ) Set the lock mode type to be used for the query execution. Parameters: lockMode - lock mode Returns: the same query instance. Throws: IllegalStateException - if the query is found
|
|
JPA Optimistic and Pessimistic Locking
Lock An entity can be locked explicitly with the lock method: em. lock (employee, LockModeType ... while the transaction is active, as follows: em. lock (employee, LockModeType . NONE ); Other Explicit ... employee = em. find ( Employee.class, 1, LockModeType . PESSIMISTIC_WRITE ); Similarly, the refresh
|
|
JPA Runtime Tuning & Configuration
exclusive ( WRITE ). Scope Usage Query setLockMode( LockModeType ) Operation Implements: FindOption ... setFlushMode N/A LockModeType N/A N/A setLockMode lock find refresh PessimisticLockScope Property
|
|
jakarta.persistence.EntityManager
pessimistic lock on an entity instance. The full range of possible lock types is enumerated by LockModeType ... an explicit LockModeType , allowing the client to request a specific type of lock. Interaction ... (JPA) 2.0 T find ( Class entityClass , Object primaryKey , LockModeType lockMode ) Find by primary key
|
|
Setting and Tuning of JPA Queries
lock on all the result objects: List results = query. setLockMode ( LockModeType . PESSIMISTIC_WRITE
|
|
jakarta.persistence.EntityNotFoundException
.getReference(Class,Object) EntityManager.refresh(Object) EntityManager.refresh(Object, LockModeType ) EntityManager.refresh(Object, java.util.Map) EntityManager.refresh(Object, LockModeType , java.util.Map) EntityManager.lock(Object, LockModeType ) EntityManager.lock(Object, LockModeType , java.util.Map
|
|
jakarta.persistence.OptimisticLockException
, will be marked for rollback. See Also: EntityManager.find(Class, Object, LockModeType ) EntityManager.find(Class, Object, LockModeType , java.util.Map) EntityManager.lock(Object, LockModeType ) EntityManager.lock(Object, LockModeType , java.util.Map) Since: Jakarta Persistence (JPA) 1.0 Public Constructors
|
|
jakarta.persistence.NamedQuery
) 1.0 LockModeType lockMode (Optional) The lock mode type to use in query execution. If a lockMode other than LockModeType .NONE is specified, the query must be executed in a transaction and the persistence context joined to the transaction. Default: LockModeType .NONE Since: Jakarta Persistence (JPA) 2
|
|
jakarta.persistence.LockOption
. See Also: LockModeType PessimisticLockScope Timeout EntityManager.lock(Object, LockModeType , LockOption...) Since: Jakarta Persistence (JPA) 3.2
|
|
jakarta.persistence.EntityResult
The class of the result. Since: Jakarta Persistence (JPA) 1.0 LockModeType lockMode The lock mode obtained by the SQL query. Default: LockModeType .OPTIMISTIC Since: Jakarta Persistence (JPA) 3.2 FieldResult
|
|
jakarta.persistence.TypedQuery
properties and hints. Since: Jakarta Persistence (JPA) 2.0 LockModeType getLockMode () Get the current ... ( LockModeType lockMode ) Set the lock mode type to be used for the query execution. Overrides Query
|
|
jakarta.persistence.Query
. Returns: query properties and hints. Since: Jakarta Persistence (JPA) 2.0 LockModeType getLockMode ... setLockMode ( LockModeType lockMode ) Set the lock mode type to be used for the query execution
|
|
jakarta.persistence.StoredProcedureQuery
Returns: query properties and hints. Since: Jakarta Persistence (JPA) 2.0 LockModeType getLockMode ... for the implementation. Since: Jakarta Persistence (JPA) 1.0 Query setLockMode ( LockModeType
|
|
jakarta.persistence.NamedQuery.lockMode
Jakarta Persistence (JPA) Method in jakarta.persistence.NamedQuery LockModeType lockMode (Optional) The lock mode type to use in query execution. If a lockMode other than LockModeType ... to the transaction. Default: LockModeType .NONE Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.EntityResult.lockMode
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityResult LockModeType lockMode The lock mode obtained by the SQL query. Default: LockModeType .OPTIMISTIC Since: Jakarta Persistence (JPA) 3.2
|
|
jakarta.persistence.EntityManager.refresh(Object,RefreshOption...)
, if any. If the supplied options include a LockModeType , lock the given entity, obtaining the given ... when there is no transaction and a lock mode other than LockModeType .NONE was specified; or if invoked on an extended
|
|
jakarta.persistence.FindOption
by the specification. See Also: LockModeType PessimisticLockScope CacheRetrieveMode CacheStoreMode
|
|
jakarta.persistence.Version
. See Also: LockModeType PersistenceUnitUtil.getVersion(Object) Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.RefreshOption
defined by the specification. See Also: LockModeType PessimisticLockScope CacheStoreMode Timeout
|
|
jakarta.persistence.EntityManager.getLockMode(Object)
Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager LockModeType getLockMode ( Object entity ) Get the current lock mode held by this persistence context on the given managed entity instance. Parameters: entity - a managed entity instance Returns: the lock mode
|
|
jakarta.persistence.EntityManager.find(EntityGraph,Object,FindOption...)
and primary key. If the given options include a LockModeType , lock it with respect to the specified lock
|
|
jakarta.persistence.EntityManager.find(Class,Object,FindOption...)
with the specified class and primary key. If the given options include a LockModeType , lock
|
|
jakarta.persistence.Query.getLockMode()
Jakarta Persistence (JPA) Method in jakarta.persistence.Query LockModeType getLockMode() Get the current lock mode for the query. Returns null if a lock mode has not been set on the query object. Returns: lock mode. Throws: IllegalStateException - if the query is found not to be a Jakarta
|
|
"Attempt to lock a non entity object" error
.getSelectedValue(), LockModeType .PESSIMISTIC_WRITE); . . } //doEdit ... ; import javax.persistence.EntityManagerFactory; import javax.persistence. LockModeType ; import javax ... , LockModeType .PESSIMISTIC_WRITE); System.out.println
|
|
pessimistic lock not released on commit
(); System.out.println("Thread A: trying to lock..."); MyEntity e = em.find(MyEntity.class, 1L, LockModeType ... .class, 1L, LockModeType .PESSIMISTIC_WRITE); System.out.println("Thread B: got lock, updating..."); e
|
|
EntityTransaction.commit() does not release a pessimistic lock
.getTransaction().begin(); Account a1 = em1.find(Account.class, 0, LockModeType .PESSIMISTIC_WRITE); a1 ... ().begin(); Account a2 = em2.find(Account.class, 0, LockModeType .PESSIMISTIC_READ
|
|
Duplicate Entity class names causes Exception in Query
.CheckCacheThenDatabase); /* q.setLockMode( LockModeType .OPTIMISTIC); */ try { java.lang.Object r = q.getSingleResult
|
|
Optimistic locking failure
an exception in this case. support Support It would be great if was fixed the same problem with LockModeType
|
|
Unable to persist TreeMap
.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence. LockModeType ; import
|
|
ObjectDB 2.4.0
of entity classes ( issue #672 ). Fixed LockModeType .OPTIMISTIC ( READ ) by handling it as OPTIMISTIC_FORCE_INCREMENT . Fixed a bug in optimistic locking on find by using LockModeType .WRITE . Fixed
|
|
ObjectDB 2.8.5
LockModeType .NONE. Fixed a bug in recovery from an exception during inverse (mapped-by) retrieval
|
|
Pessimistic lock timeout - blocks indefinitely
.class, 1, LockModeType .PESSIMISTIC_WRITE, properties); One thread manages to do its update
|