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 14:36:03 GMT
> If I change to  fetch.setWriteLockMode(LockModeType.WRITE), does it
guarantee that the record will be held for one thread until it is committed?

I assume you're using the default lock manager(Version), so no setting
LockModeType.WRITE will not lock the database record. I believe you need to
set openjpa.LockManager to pessimistic in your persistence.xml file and set
the WriteLockMode to WRITE to to get database locking.

I think a good place to start would be to read through the user manual[1]
regarding locking...
-- 
Thanks,
Rick

[1]
http://openjpa.apache.org/builds/1.2.2/apache-openjpa-1.2.2/docs/manual/manual.html#ref_guide_locking_lockmgr

On Tue, Apr 13, 2010 at 9:39 PM, Angelo K. Huang <angelokh@ymail.com> wrote:

>
> If I change to  fetch.setWriteLockMode(LockModeType.WRITE), does it
> guarantee
> that the record will be held for one thread until it is committed?
> --
> View this message in context:
> http://n2.nabble.com/ReadLock-Questions-tp4898922p4899643.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

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