Author: epbernard
Date: 2009-12-08 11:01:36 -0500 (Tue, 08 Dec 2009)
New Revision: 18162
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
Log:
Bind Hibernate Core deprecated lock modes for completeness and map UPGRADE_NOWAIT like
PESSIMISTIC_WRITE with a timeout of 0
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
===================================================================
---
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-08
15:40:12 UTC (rev 18161)
+++
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-08
16:01:36 UTC (rev 18162)
@@ -570,9 +570,13 @@
return LockModeType.OPTIMISTIC_FORCE_INCREMENT;
else if ( lockMode == LockMode.PESSIMISTIC_READ )
return LockModeType.PESSIMISTIC_READ;
- else if ( lockMode == LockMode.PESSIMISTIC_WRITE )
+ else if ( lockMode == LockMode.PESSIMISTIC_WRITE
+ || lockMode == LockMode.UPGRADE
+ || lockMode == LockMode.UPGRADE_NOWAIT) //timeout of 0
+ //TODO check that if we have UPGRADE_NOWAIT we have a timeout of zero?
return LockModeType.PESSIMISTIC_WRITE;
- else if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT )
+ else if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT
+ || lockMode == LockMode.FORCE)
return LockModeType.PESSIMISTIC_FORCE_INCREMENT;
throw new AssertionFailure("unhandled lock mode " + lockMode );
}