[CDO] Explicit Locking feature. [message #427335] |
Thu, 12 February 2009 09:03  |
Eclipse User |
|
|
|
Hi,
I tested the "write lock" feature.
Does an API exist to check if an object is already locked (who (cdo
session ?) owns the lock, which lock type,...) ?
What is the purpose of the "read lock" ? I did not see the difference
with a write lock ...
Stephane.
--
|
|
|
|
|
|
Re: [CDO] Explicit Locking feature. [message #427343 is a reply to message #427342] |
Thu, 12 February 2009 13:42  |
Eclipse User |
|
|
|
Stéphane Fournier wrote:
> Simon & Victor,
> Thanks for your helpful answers.
You are welcome!
> Simon, could you give me please an example of a typical usage of the
> readLock.
If you want to calculates something on a bunch of objects.. and you do not
allow changes during that time..... otherwise your answer will not be
accurate. But you allo others to read them!! :-) I'm sure you can come up
with a better example.
> If I clearly understood, a readLock allows its owner to avoid
> modifications by another one.
Yes, it is exactly that.
> Hence, multiples users reading an object can lock it to prevent other
> ones to modify it while they are reading it.
Yes.
> The writeLock can be used to tell to other ones, the object is under
> modifications.... A commit will happen...
Yes this is one reason.
> Am I right Simon ?
Yes. Don't forget that each time you commit... the write lock is kicked-in
automatically.
> Stéphane.
> Simon Mc Duff wrote:
>> Hi Stephane,
>>
>> The difference between read and lock is the following:
>>
>> - Many Read locks could happen at the same time (From different views)
>> - cdoWriteLock is successful only if they have no readlock and nowriteLock
>> - cdoWriteLock could only happen from the same views. - If a clientA
>> modify objectA and clientB have a readLock on it... the commit of
>> clientA will fail. Since the commit manager will automatically
>> writeLock every Dirty Objects.
>>
>> Is that help you Stephane ?
>>
>>
> --
|
|
|
Powered by
FUDForum. Page generated in 0.09579 seconds