About setLockMode

1-9 of 9Refresh
JPA Doc
94

setLockMode(lockMode)

Method javax.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 not to be a Java Persistence query language SELECT query or a Criteria API query Since: JPA 2.0
JPA Doc
94

setLockMode(lockMode)

Method javax.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 - if the query is found not to be a Java Persistence
Manual
91

Setting and Tuning of JPA Queries

. Therefore, when performance is important, this issue has to be considered. Lock Mode (setLockMode) ObjectDB ... . JPA 2 adds support for pessimistic locking. The setLockMode method sets a lock mode ... .setLockMode(LockModeType.PESSIMISTIC_WRITE) .getResultList(); Notice that when a query
Manual
26

JPA Named Queries

and hints, provide static replacement for the setLockMode and setHint methods. Every @NamedQuery annotation
JPA Doc
11

javax.persistence.LockModeType

.setLockMode() or TypedQuery.setLockMode() method. Lock modes can be used to specify either optimistic or
JPA Doc
11

javax.persistence.TypedQuery

argument is not valid for the implementation Since: JPA 2.0 Query setLockMode( LockModeType lockMode ... a Criteria API query Since: JPA 2.0 TypedQuery setLockMode( LockModeType lockMode) Set the lock
JPA Doc
7

javax.persistence.Query

Query setLockMode( LockModeType lockMode) Set the lock mode type to be used for the query execution
Forum
2

Duplicate Entity class names causes Exception in Query

.setHint(QueryHints.CACHE_USAGE, CacheUsage.CheckCacheThenDatabase); /* q.setLockMode(LockModeType
Issue
2

Threaded Test - Failed to commit transaction: Unexpected internal exception

("SELECT p FROM Point p");                 Point p = (Point)q.setMaxResults(1).setLockMode