Query.setLockMode currently states:
"@throws IllegalStateException if the query is found not to be
* a Java Persistence query language SELECT query
* or a Criteria API query"
To be consistent with the JPQL semantics, this should be restated as
"@throws IllegalStateException if the query is found not to be
* a Java Persistence query language SELECT query
* or a CriteriaQuery query"
I.e., we disallow setting query lock modes for update and delete "queries"
I plan to make this change, so yell now if you disagree.
thanks,
-Linda