Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Need to modify the locking mechanism in CDO
Need to modify the locking mechanism in CDO [message #945181] Mon, 15 October 2012 09:27 Go to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi,

I am doing my Master Thesis based on CDO and DAWN. Currently I am doing research on existing locking mechanism in DAWN editors(for example, locking mechanisms in the dawn editors like "DAWN Acore Editor").

I have installed the source of CDO. From this, I could lock the EMF objects by the help of context menu Lock-> Lock Object.

I need to extend this feature like the following:

If an user is current editing an object, it should be automatically locked for him. Then, the object should be automatically unlocked, as soon as he starts editing another object.

Any tips for adding this feature to the CDO source(locally in my workspace) will be appreciated.
Re: Need to modify the locking mechanism in CDO [message #945263 is a reply to message #945181] Mon, 15 October 2012 10:15 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 15.10.2012 11:27, schrieb UmaShankar Subramani:
> Hi,
>
> I am doing my Master Thesis based on CDO and DAWN. Currently I am doing research on existing locking mechanism in
> DAWN editors(for example, locking mechanisms in the dawn editors like "DAWN Acore Editor").
>
> I have installed the source of CDO. From this, I could lock the EMF objects by the help of context menu Lock-> Lock
> Object.
>
> I need to extend this feature like the following:
>
> If an user is current editing an object, it should be automatically locked for him.
You can add a CDOTransactionHandler1 (or CDODefaultTransactionHandler1) to the local CDOTransaction and implement the
modifyingObject() method to be notified *before* any object is modified. There you can, for example, acquire a lock on
the to-be-modified object.

> Then, the object should be automatically unlocked, as soon as he starts editing another object.
Without a prior commit()?

>
> Any tips for adding this feature to the CDO source(locally in my workspace) will be appreciated.
What you want to do seems similar to this: http://fmadiot.blogspot.de/2012/10/how-to-share-modeling-project-with.html

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #946448 is a reply to message #945263] Tue, 16 October 2012 07:57 Go to previous messageGo to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi,

Thanks for replying. I will try doing this and get back to you, if I face some problems.


Please see the comments below:

>Without a prior commit()?

Yes, it is because, Just to make sure that, another guy is not editing the same object, at the same time. But once, editing is done, it is available to others very soon.
Re: Need to modify the locking mechanism in CDO [message #946539 is a reply to message #946448] Tue, 16 October 2012 08:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.10.2012 09:57, schrieb UmaShankar Subramani:
> Hi,
>
> Thanks for replying. I will try doing this and get back to you, if I face some problems.
>
>
> Please see the comments below:
>
>> Without a prior commit()?
>
> Yes, it is because, Just to make sure that, another guy is not editing the same object, at the same time. But once,
> editing is done, it is available to others very soon.
Please note that CDO, by default, automatically and atomically releases all locks at commit time.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951554 is a reply to message #946539] Sat, 20 October 2012 21:03 Go to previous messageGo to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi Eike,

I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject() method in this object, looks like the following now.
But, it is not what I actually wanted.

What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this Right click -> Lock -> Lock).

Is it possible?



public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
{
object.cdoWriteLock();
}
Re: Need to modify the locking mechanism in CDO [message #951902 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951908 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951915 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951922 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951929 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951936 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951943 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951950 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951957 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951964 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951971 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951978 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951985 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951992 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #951999 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952006 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952013 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952020 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952027 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952035 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952043 is a reply to message #951554] Sun, 21 October 2012 04:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 23:03, schrieb UmaShankar Subramani:
> Hi Eike,
>
> I created CDOTransactionHandler1 object locally and added it to the CDOTransaction object. The modifyingObject()
> method in this object, looks like the following now.
It's wrong, see below.

> But, it is not what I actually wanted.
> What I want is, I wanted to get it locked with the lock symbol visible on it(same like what happens in when I do this
> Right click -> Lock -> Lock).
>
> Is it possible?
Whether locks are reflected visually depends on your label provider / decorator.

> public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
> {
> object.cdoWriteLock();
Correct:

CDOLock writeLock = object.cdoWriteLock();
writeLock.lock(1000L);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #952250 is a reply to message #952043] Sun, 21 October 2012 09:36 Go to previous messageGo to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi Eike,

Thanks. It works as expected.

But, I want to slightly modify the same functionality as below.

If I click on an object, its parent should be locked automatically. And it should remain locked, until I click on another object.

Clicking on an object means that, I am working on that object. So, the parent of the object should be locked automatically. Is it possible?

[Updated on: Sun, 21 October 2012 09:41]

Report message to a moderator

Re: Need to modify the locking mechanism in CDO [message #952255 is a reply to message #952250] Sun, 21 October 2012 09:39 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 21.10.2012 11:36, schrieb UmaShankar Subramani:
> Hi Eike,
>
> Thanks. It works as expected.
>
> But, I want to slightly modify the same functionality as below.
>
> If I click on an object, it should be locked automatically. And it should remain locked, until I click on another object.
> Clicking on an object means that, I am working on that object. Is it possible?
Almost everything is possible but clicks can only be detected by your user interface.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #955052 is a reply to message #952255] Tue, 23 October 2012 13:17 Go to previous messageGo to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
I need to unlock all the objects locked by me at the same time, but clicking some menu item. How can I achieve this?
Re: Need to modify the locking mechanism in CDO [message #956219 is a reply to message #955052] Wed, 24 October 2012 10:30 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 23.10.2012 15:17, schrieb UmaShankar Subramani:
> I need to unlock all the objects locked by me at the same time, but clicking some menu item. How can I achieve this?
With a listener in your user interface?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Need to modify the locking mechanism in CDO [message #957649 is a reply to message #956219] Thu, 25 October 2012 11:41 Go to previous message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Yes. Using the CDO source I have installed.
Previous Topic:[CDO] Oracle Adapter Wanted
Next Topic:EMF Enum editing
Goto Forum:
  


Current Time: Fri Apr 19 01:05:05 GMT 2024

Powered by FUDForum. Page generated in 0.03158 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top