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 |
|
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 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Getting locked elements of durable transactions [message #730451 is a reply to message #730414] |
Wed, 28 September 2011 12:41 |
|
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 |
|
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
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 |
|
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 ?
|
|
| | |
Goto Forum:
Current Time: Wed Apr 24 17:13:40 GMT 2024
Powered by FUDForum. Page generated in 0.03284 seconds
|