Support for Query.setHint(javax.persistence.lock.timeout)
---------------------------------------------------------
Key: HHH-6846
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6846
Project: Hibernate Core
Issue Type: New Feature
Reporter: Christian Bauer
Priority: Minor
"This hint may be used with the methods of the EntityManager interface that allow
lock modes to be specified, the Query.setLockMode method and the NamedQuery
annotation."
List<Item> items =
em.createQuery("select i from Item i where i.category.id = :catId")
.setLockMode(LockModeType.PESSIMISTIC_WRITE)
.setParameter("catId", categoryId)
.setHint("javax.persistence.lock.timeout", 5000) // Currently
ignored!
.getResultList();
This should be quite easy to implement:
- org.hibernate.ejb.AbstractQueryImpl#setHint() needs to recognize the new property
- similar to the abstract applyTimeout() a new method applyLockTimeout() can be added
- the implementation in org.hibernate.ejb.QueryImpl calls the
org.hibernate.Query.setLockOptions(...) method on its delegate
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira