]
Adrian Hummel commented on HHH-5027:
------------------------------------
BTW: The lock method does only support the timeout when used with {{PESSIMISTIC_WRITE}}
(i.e. the {{PessimisticWriteSelectLockingStrategy}}) but not with
{{PESSIMISTIC_FORCE_INCREMENT}}:
{code}
lock(entity, LockModeType.PESSIMISTIC_FORCE_INCREMENT, props);
{code}
The {{PessimisticForceIncrementLockingStrategy}} ignores the timeout parameter.
javax.persistence.lock.timeout ignored by EntityManager#find method
-------------------------------------------------------------------
Key: HHH-5027
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5027
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.5.0-CR-2
Environment: Oracle 10g XE
Reporter: Adrian Hummel
The EntityManager *lock* method does support the {{javax.persistence.lock.timeout}}
property whereas the *find* method does not:
Works:
{code}
Map<String, Object> props = new HashMap<String, Object>();
props.put("javax.persistence.lock.timeout", 4000);
em.lock(entity, LockModeType.PESSIMISTIC_WRITE, props); // select ... update wait 4
{code}
Does not work:
{code}
Map<String, Object> props = new HashMap<String, Object>();
props.put("javax.persistence.lock.timeout", 4000);
em.find(MyEntity.class, pk, LockModeType.PESSIMISTIC_WRITE, props); // select ... update
{code}
Note: setting the property by means of the persistence.xml (instead of passing as
property map) had no effect in both situations.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: