[hibernate-dev] JPA2 locking followup...
smarlow at redhat.com
Fri Oct 30 09:18:25 EDT 2009
For JPA2 support, I propose that Hibernate LockMode support the
following equivalents of JPA2 LockModeType locks:
Hibernate already supports NONE, so that doesn't need to be added. JPA2
defaults to LockModeType NONE.
JPA1 READ + WRITE will be supported respectively via LockMode.OPTIMISTIC
With this change, Hibernate (native (better term?)) applications would
be able to request JPA2 like locks. This also means that JPA2
applications running with the Hibernate Entity Manager, will see similar
locking behavior as native applications.
- Application developers will have a consistent set of locking options
in their JPA2 based applications and native Hibernate applications.
- This helps the application developer to prepare their native Hibernate
application to migrate to JPA2.
- This ties Hibernate core locking internals to the JPA2 specification.
As JPA continues to evolve, Hibernate core should follow in lockstep.
Although, that is not a hard requirement.
- An alternative would be introducing low level locking primitives that
could be combined to support JPA2 style locks. I can explore this path
if there is strong push back to the above proposal.
More information about the hibernate-dev