ObjectDB Database Search

1-46 of 46 results

Locking in JPA

explicitly by the lock method: em. lock (employee, LockModeType . PESSIMISTIC_WRITE ); The first ... , LockModeType . NONE ); Other Explicit Lock Modes In addition to the two main pessimistic modes ... ( Employee.class, 1, LockModeType . PESSIMISTIC_WRITE ); Similarly, the refresh method

EnumRef jakarta.persistence.LockModeType

JPA Enum LockModeType java.lang.Object ∟  java.lang.Enum ∟  jakarta.persistence. LockModeType Implemented Interfaces: FindOption , RefreshOption Enumerates the kinds of optimistic or ... passing an explicit LockModeType as an argument to: one of the methods of EntityManager which obtains

EnumConstRef jakarta.persistence.LockModeType.OPTIMISTIC_FORCE_INCREMENT

JPA Enum Constant in jakarta.persistence. LockModeType OPTIMISTIC_FORCE_INCREMENT Optimistic lock, with version update. Since: JPA 2.0

EnumConstRef jakarta.persistence.LockModeType.OPTIMISTIC

JPA Enum Constant in jakarta.persistence. LockModeType OPTIMISTIC Optimistic lock. Since: JPA 2.0

EnumConstRef jakarta.persistence.LockModeType.WRITE

JPA Enum Constant in jakarta.persistence. LockModeType WRITE Synonymous with OPTIMISTIC_FORCE_INCREMENT . OPTIMISTIC_FORCE_INCREMENT is preferred for new applications. Since: JPA 1.0

EnumConstRef jakarta.persistence.LockModeType.READ

JPA Enum Constant in jakarta.persistence. LockModeType READ Synonymous with OPTIMISTIC . OPTIMISTIC is preferred for new applications. Since: JPA 1.0

EnumConstRef jakarta.persistence.LockModeType.PESSIMISTIC_FORCE_INCREMENT

JPA Enum Constant in jakarta.persistence. LockModeType PESSIMISTIC_FORCE_INCREMENT Pessimistic write lock, with version update. Since: JPA 2.0

EnumConstRef jakarta.persistence.LockModeType.NONE

JPA Enum Constant in jakarta.persistence. LockModeType NONE No lock. Since: JPA 2.0

EnumConstRef jakarta.persistence.LockModeType.PESSIMISTIC_WRITE

JPA Enum Constant in jakarta.persistence. LockModeType PESSIMISTIC_WRITE Pessimistic write lock. Since: JPA 2.0

EnumConstRef jakarta.persistence.LockModeType.PESSIMISTIC_READ

JPA Enum Constant in jakarta.persistence. LockModeType PESSIMISTIC_READ Pessimistic read lock. Since: JPA 2.0

Setting and Tuning of JPA Queries

( LockModeType . PESSIMISTIC_WRITE ) . getResultList (); Notice that when a query is executed

InterfaceRef jakarta.persistence.EntityManager

by LockModeType . Some operations of this interface, including the methods (Object, LockModeType ) , (Object, LockModeType ) , and (Class, Object, LockModeType ) , accept an explicit LockModeType ... , RefreshOption...) accepts RefreshOption s, and (Object, LockModeType , LockOption...) accepts

"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

AnnotationAttrRef jakarta.persistence.NamedQuery.lockMode

JPA Annotation Attribute in jakarta.persistence.NamedQuery LockModeType lockMode default LockModeType .NONE (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. Since: JPA 2.0

AnnotationRef jakarta.persistence.NamedQuery

LockModeType lockMode default LockModeType .NONE (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

AnnotationRef jakarta.persistence.EntityResult

of the entity class. Since: JPA 1.0 LockModeType lockMode default LockModeType .OPTIMISTIC The lock mode obtained by the SQL query. Since: JPA 3.2

EntityManager.refresh(entity,options) - JPA Method

. If the supplied options include a LockModeType , lock the given entity, obtaining the given lock mode ... other than {@link LockModeType #NONE} was specified; or if invoked on an extended entity manager that has not

InterfaceRef jakarta.persistence.Query

. Return: query properties and hints Since: JPA 2.0 LockModeType getLockMode () Get the current lock ... - if the second argument is not valid for the implementation Since: JPA 1.0 Query setLockMode ( LockModeType  

InterfaceRef jakarta.persistence.TypedQuery

and hints Inherited from: Query Since: JPA 2.0 LockModeType getLockMode () Get the current lock mode ... ( LockModeType  lockMode) Set the lock mode type to be used for the query execution. Parameters: lockMode

AnnotationAttrRef jakarta.persistence.EntityResult.lockMode

JPA Annotation Attribute in jakarta.persistence.EntityResult LockModeType lockMode default LockModeType .OPTIMISTIC The lock mode obtained by the SQL query. Since: JPA 3.2

InterfaceRef jakarta.persistence.StoredProcedureQuery

.0 LockModeType getLockMode () Get the current lock mode for the query. Returns null if a lock mode ... argument is not valid for the implementation Since: JPA 2.1 Query setLockMode ( LockModeType  

EntityManager.refresh(entity,lockMode,properties) - JPA Method

JPA Method in jakarta.persistence.EntityManager void refresh (   Object entity,     LockModeType  lockMode,    Map  properties ) Refresh ... and a lock mode other than {@link LockModeType #NONE} was specified; or if invoked on an extended

EntityManager.refresh(entity,lockMode) - JPA Method

JPA Method in jakarta.persistence.EntityManager void refresh (   Object entity,     LockModeType  lockMode ) Refresh the state of the given managed entity instance ... and a lock mode other than {@link LockModeType #NONE} was specified; or if invoked on an extended

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

Query.setLockMode(lockMode) - JPA Method

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 Return: the same query instance Throws: IllegalStateException - if the query is found not

EntityManager.lock(entity,lockMode,options) - JPA Method

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 plain, using

InterfaceRef jakarta.persistence.FindOption

JPA Interface FindOption An option influencing the behavior of EntityManager.find . Built-in options control plain, plain, and plain. This interface may be implemented by custom provider-specific options which extend the options defined by the specification. See Also: LockModeType

EntityManager.find(entityClass,primaryKey,options) - JPA Method

with the specified class and primary key. If the given options include a LockModeType , lock it with respect

EntityManager.find(entityGraph,primaryKey,options) - JPA Method

and primary key. If the given options include a LockModeType , lock it with respect to the specified lock

Query.getLockMode() - JPA Method

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. Return: lock mode Throws: IllegalStateException - if the query is found not to be a Jakarta Persistence query language

AnnotationRef jakarta.persistence.Version

: See Also: LockModeType PersistenceUnitUtil.getVersion Since: JPA 1.0 The JPA Entity Fields article

EntityManager.getLockMode(entity) - JPA Method

JPA Method in jakarta.persistence.EntityManager LockModeType getLockMode (   Object entity ) Get the current plain held by this persistence context on the given managed entity instance. Parameters: entity - a managed entity instance Return: the lock mode currently held Throws

EntityManager.lock(entity,lockMode,properties) - JPA Method

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 plain, using the specified

EntityManager.lock(entity,lockMode) - JPA Method

JPA Method in jakarta.persistence.EntityManager void lock (   Object entity,     LockModeType  lockMode ) Lock an entity instance belonging to the persistence context, obtaining the specified plain. If a pessimistic lock mode type is specified and the entity

TypedQuery.setLockMode(lockMode) - JPA Method

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 Return: the same query instance Throws: IllegalStateException - if the query is found not

EntityManager.find(entityClass,primaryKey,lockMode) - JPA Method

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

InterfaceRef jakarta.persistence.RefreshOption

JPA Interface RefreshOption An option influencing the behavior of EntityManager.refresh . Built-in options control plain, plain, and plain. This interface may be implemented by custom provider-specific options which extend the options defined by the specification. See Also: LockModeType

InterfaceRef jakarta.persistence.LockOption

JPA Interface LockOption An option influencing the behavior of EntityManager.lock . Built-in options control plain, and plain. This interface may be implemented by custom provider-specific options which extend the options defined by the specification. See Also: LockModeType PessimisticLockScope Timeout EntityManager.lock Since: JPA 3.2

EntityManager.find(entityClass,primaryKey,lockMode,properties) - JPA Method

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

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