openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: ReadLock Questions
Date Wed, 14 Apr 2010 17:23:43 GMT
> Do you mean the default lock manager can use any kind of LockModeType to
lock the object?

No. Per the documentation:

"version: An alias for the
org.apache.openjpa.kernel.VersionLockManager<http://openjpa.apache.org/builds/1.2.2/apache-openjpa-1.2.2/docs/javadoc/org/apache/openjpa/kernel/VersionLockManager.html>.
*This lock manager does not perform any exclusive locking*, but instead
ensures read consistency by verifying that the version of all read-locked
instances is unchanged at the end of the transaction."

If you want to use database locking you'll need to use the pessimistic lock
manager. I'd suggest chewing on the documentation and testing to ensure that
you are getting the expected behavior.

-- 
Thanks,
Rick

On Wed, Apr 14, 2010 at 12:09 PM, Angelo K. Huang <angelokh@ymail.com>wrote:

>
> > I assume you're using the default lock manager(Version), so no setting
> LockModeType.WRITE will not lock the database record.
>
> Do you mean the default lock manager can use any kind of LockModeType to
> lock the object? You are right that I am using default lock manager
> (version). If I set to pessimistic and use "WriteLockMode = WRITE", does it
> hold the record within whole transaction?
> --
> View this message in context:
> http://n2.nabble.com/ReadLock-Questions-tp4898922p4902853.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message