Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Getting locked elements of durable transactions
[CDO] Getting locked elements of durable transactions [message #730363] Wed, 28 September 2011 08:45 Go to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi eveyone,

I must be missing some API, but I cannot get the collection of
CDOObjects (or CDOIds) locked by a given CDOTransaction.

Before I was able to maintain a collection of locked elements, but with
the new durable locking capabilities of CDO 4.0 (which work like a charm
btw), I am not able to properly determine which elements were locked
before closing (Eclipse could have been restared).

I'm sure it's an info that you have on the server side, and that it's
possible to get from the CDOTransaction, but I juste don't see how.

Thanks by advance for your answer :)
Alex
Re: [CDO] Getting locked elements of durable transactions [message #730414 is a reply to message #730363] Wed, 28 September 2011 10:49 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Alex,

I can not remember that I designed a respective API (nor the needed protocol) but I think it would make sense to provide
it. The effort will probably not be very high as the server side infrastructure must be in place already (the
CDOCommandHandler does already provide this piece of information on the OSGi console). Please file a bugzilla to track
the progress.

Cheers
/Eike

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



Am 28.09.2011 10:45, schrieb Alex Lagarde:
> Hi eveyone,
>
> I must be missing some API, but I cannot get the collection of CDOObjects (or CDOIds) locked by a given CDOTransaction.
>
> Before I was able to maintain a collection of locked elements, but with the new durable locking capabilities of CDO
> 4.0 (which work like a charm btw), I am not able to properly determine which elements were locked before closing
> (Eclipse could have been restared).
>
> I'm sure it's an info that you have on the server side, and that it's possible to get from the CDOTransaction, but I
> juste don't see how.
>
> Thanks by advance for your answer :)
> Alex


Re: [CDO] Getting locked elements of durable transactions [message #730451 is a reply to message #730414] Wed, 28 September 2011 12:41 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

OK that's great !

Do you want me to file a feature request on the bugzilla ?

As we are talking about API, we recently made a prototype of user
identification, and I had the feeling that this feature was not properly
integrated in the API of CDO : for example, these are common use cases
that cannot be written with current API :
- get, for each CDOObject, its history, associating each historical
modification with the user that has commited it
- get all the CDOObjects locked by a given user

Thanks again for your fast replies :)
Alex
Re: [CDO] Getting locked elements of durable transactions [message #730484 is a reply to message #730451] Wed, 28 September 2011 13:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 28.09.2011 14:41, schrieb Alex Lagarde:
> OK that's great !
>
> Do you want me to file a feature request on the bugzilla ?
Yes, please.

>
> As we are talking about API, we recently made a prototype of user identification, and I had the feeling that this
> feature was not properly integrated in the API of CDO : for example, these are common use cases that cannot be written
> with current API :
> - get, for each CDOObject, its history, associating each historical modification with the user that has commited it
That should be possible already with a combination of the revision manager and the commit info manager (and possibly
additional audit views):

1) use revision manager to determine the commit times of the previous revisions of an object
2) use commit info manager to determine
a) the commit "meta data", such as userID, commit comment, ...
b) or the commit change set (additions, changes, removals)
3) open additional audit views with the information from 2) to see the object in their "context" (the graph) at past times

> - get all the CDOObjects locked by a given user
Such API is not yet available but could be designed as part of the bugzilla you're about to raise.

Please note that authentication is generally optional for a CDO server and in case it's not configured the userID in
various places (session, commit infos, ...) will be null. That why we associate locks with views, not with users. That
said, for durable views we do persist the userID of the the session that originally opened the durable view. And there's
a new server-side hook that can be used to control "who" is allowed to resume a durable view, see
*https://bugs.eclipse.org/bugs/show_bug.cgi?id=352330 .*

Cheers
/Eike

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


Re: [CDO] Getting locked elements of durable transactions [message #730518 is a reply to message #730484] Wed, 28 September 2011 14:37 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Bugzilla raised : https://bugs.eclipse.org/bugs/show_bug.cgi?id=359244

A last question though : don't you think that the
CDOView.unlockObjects(Collection<? extends CDOObject> objects, LockType
lockType) should use CDOIDs instead of CDOObjects ?

For example, if I lock an element A and then delete it, and that
autorelease locks is false, I am not able to release the lock acquired
on A, because if I Try to obtain the CDOObject I get an
ObjectNotFoundException.

It should be great to have this on the lockObjects() method too, for
more complex reasons.

What do you think ?
Re: [CDO] Getting locked elements of durable transactions [message #730574 is a reply to message #730518] Wed, 28 September 2011 16:09 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 28.09.2011 16:37, schrieb Alex Lagarde:
> Bugzilla raised : https://bugs.eclipse.org/bugs/show_bug.cgi?id=359244
>
> A last question though : don't you think that the CDOView.unlockObjects(Collection<? extends CDOObject> objects,
> LockType lockType) should use CDOIDs instead of CDOObjects ?
It could, but I'm not sure it has to ;-)

>
> For example, if I lock an element A and then delete it, and that autorelease locks is false, I am not able to release
> the lock acquired on A, because if I Try to obtain the CDOObject I get an ObjectNotFoundException.
With a traditional non-durable view all locks are released when the view is closed (for whatever reason). With durable
views/locking there's always the server console where an admin can fix everything.

>
> It should be great to have this on the lockObjects() method too, for more complex reasons.
I don't see why it couldn't be there. Probably the effort is not that much. Please submit a bugzilla to remind me.

Cheers
/Eike

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


Re: [CDO] Getting locked elements of durable transactions [message #730576 is a reply to message #730518] Wed, 28 September 2011 16:09 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 28.09.2011 16:37, schrieb Alex Lagarde:
> Bugzilla raised : https://bugs.eclipse.org/bugs/show_bug.cgi?id=359244
>
> A last question though : don't you think that the CDOView.unlockObjects(Collection<? extends CDOObject> objects,
> LockType lockType) should use CDOIDs instead of CDOObjects ?
It could, but I'm not sure it has to ;-)

>
> For example, if I lock an element A and then delete it, and that autorelease locks is false, I am not able to release
> the lock acquired on A, because if I Try to obtain the CDOObject I get an ObjectNotFoundException.
With a traditional non-durable view all locks are released when the view is closed (for whatever reason). With durable
views/locking there's always the server console where an admin can fix everything.

>
> It should be great to have this on the lockObjects() method too, for more complex reasons.
I don't see why it couldn't be there. Probably the effort is not that much. Please submit a bugzilla to remind me.

Cheers
/Eike

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


Previous Topic:Working with TransactionalEditingDomain
Next Topic:EMF4Net dead?
Goto Forum:
  


Current Time: Wed Apr 24 17:13:40 GMT 2024

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

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

Back to the top