Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Walking the graph of a revision
[CDO] Walking the graph of a revision [message #502511] Tue, 08 December 2009 15:46 Go to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
Hi,

If I retrieve some revision of an object and walk its graph, how are the retrieved objects determined. Are they consistent with the revision's sense of time? If so what factors are used to determine which objects are returned?

Thanks,
Joel
Re: [CDO] Walking the graph of a revision [message #502529 is a reply to message #502511] Tue, 08 December 2009 17:29 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6454
Registered: July 2009
Senior Member
Hi Joel,

I'm a bit confused by your usage of the term graph in the context of
revisions. My understanding of a graph is a graph of objects because
only objects point to other objects. CDORevisions point to CDOIDs and
you can use these IDs in combination with the CDORevisionManager of the
CDOSession to get the target revisions of these IDs (getRevision,
getRevisionByTime or getRevisionByVersion) or in combination with a
CDOView ( or CDOAudit or CDOTransaction) by calling getObject(ID). Does
that answer your question?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Joel Rosi-Schwartz schrieb:
> Hi,
>
> If I retrieve some revision of an object and walk its graph, how are
> the retrieved objects determined. Are they consistent with the
> revision's sense of time? If so what factors are used to determine
> which objects are returned?
>
> Thanks,
> Joel


Re: [CDO] Walking the graph of a revision [message #502536 is a reply to message #502529] Tue, 08 December 2009 18:14 Go to previous messageGo to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
Hi Eike,

Hmm... I'm not sure, so possibly if I try to be a bit clearer it will help us both Wink

So far I learned that I can use a CdoSession to open an audit View on a Resource. My impression was that I could somehow use this view to walk the object graph of the resource I used to to create it. Is this correct so far?

Then I ran into some code that demonstrated how to get a revision of a given CdoObject. I was therefore wondering if/how I could use this Revision to obtain a consistent object graph. I gather now that I would probably have to use it to open new audit View.

Possibly it is too early for me to be asking these questions as I am just getting my head around CDO; I finally have the time to pursue it now. To tell the truth I am finding it a bit rough going as the docs online seem a bit fractious; there a number of links that are broke or content that is not in place. I am not complaining Eike as CDO is great, I just wish it was a bit easier to approach.

My next step is to set up the server and example code. I am sure this experience will illuminate much.

Many thanks,
Joel

[Updated on: Tue, 08 December 2009 21:13]

Report message to a moderator

Re: [CDO] Walking the graph of a revision [message #502611 is a reply to message #502536] Wed, 09 December 2009 06:51 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6454
Registered: July 2009
Senior Member
Joel Rosi-Schwartz schrieb:
> Hi Eike,
>
> Hmm... I'm not sure, so possibly if I try to be a but clearer it will
> help us both ;)
>
> So far I learned that I can use a CdoSession to open an audit View on
> a Resource.
To be exact, a CDOView is always a view to the whole repository, i.e.
the object graph therein at a certain point in time (later possibly in a
certain branch).

> My impression was that I could somehow use this view to walk the
> object graph of the resource I used to to create it. Is this correct
> so far?
Yes, the object graph of the resource and all the other resources that
are reachable from there.

>
> Then I ran into some code that that demonstrated how to get a revision
> of a given CdoObject.
Yes, there's API to access the CDORevision of a CDOObject. This is
mostly useful for custom audit tooling that accesses CDO system data
like "created" and "revised" timestamps. You can also use the
CDORevisionData API to access the raw data of an object, e.g. to work
with reference target IDs without resolving them to a target object.

> I was therefore wondering if and how I could use this Revision to
> obtain a consistent object graph.
Why are you thinking about this? You have already a CDOAudit view to
obtain a consistent object graph.

> I gather now that I would probably have to use it to open new audit View.
Why should it be a *new* audit view? You have already one.
>
> Possibly it is too early for me to be asking this as I am just getting
> my head around CDO; I finally have the time to pursue it. To tell the
> truth I am finding it a bit rough going as the docs online seem a bit
> fractious; there a number of links that are broke or content that is
> not in place. I am not complaining Eike as CDO is great, I just wish
> it was a bit easier to approach.
To be honest, I've heard this kind of complaint some times in the recent
past and that convinves me that we must focus on better introductory
documentation. Although I'm fully occupied with the development of new
functionality required by my sponsors I'll definitely try to work on
better docs over christmas. We do have a good Wiki though:
http://wiki.eclipse.org/CDO and it would be so great if more users who
mastered the initial challenges would write tutorials and add them to
the wiki. It'd be an invaluable contribution and save me time to add
cool new functions like branching and an offline mode.

>
> My next step is to set up the server and example code. I am sure this
> experience will be illuminate much.
There are several wiki articles describing possible setups of a
repository server. Have fun ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Walking the graph of a revision [message #502612 is a reply to message #502611] Wed, 09 December 2009 07:01 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6454
Registered: July 2009
Senior Member
See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=297142

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Eike Stepper schrieb:
> Joel Rosi-Schwartz schrieb:
>> Hi Eike,
>>
>> Hmm... I'm not sure, so possibly if I try to be a but clearer it will
>> help us both ;)
>>
>> So far I learned that I can use a CdoSession to open an audit View on
>> a Resource.
> To be exact, a CDOView is always a view to the whole repository, i.e.
> the object graph therein at a certain point in time (later possibly in
> a certain branch).
>
>> My impression was that I could somehow use this view to walk the
>> object graph of the resource I used to to create it. Is this correct
>> so far?
> Yes, the object graph of the resource and all the other resources that
> are reachable from there.
>
>>
>> Then I ran into some code that that demonstrated how to get a
>> revision of a given CdoObject.
> Yes, there's API to access the CDORevision of a CDOObject. This is
> mostly useful for custom audit tooling that accesses CDO system data
> like "created" and "revised" timestamps. You can also use the
> CDORevisionData API to access the raw data of an object, e.g. to work
> with reference target IDs without resolving them to a target object.
>
>> I was therefore wondering if and how I could use this Revision to
>> obtain a consistent object graph.
> Why are you thinking about this? You have already a CDOAudit view to
> obtain a consistent object graph.
>
>> I gather now that I would probably have to use it to open new audit
>> View.
> Why should it be a *new* audit view? You have already one.
>>
>> Possibly it is too early for me to be asking this as I am just
>> getting my head around CDO; I finally have the time to pursue it. To
>> tell the truth I am finding it a bit rough going as the docs online
>> seem a bit fractious; there a number of links that are broke or
>> content that is not in place. I am not complaining Eike as CDO is
>> great, I just wish it was a bit easier to approach.
> To be honest, I've heard this kind of complaint some times in the
> recent past and that convinves me that we must focus on better
> introductory documentation. Although I'm fully occupied with the
> development of new functionality required by my sponsors I'll
> definitely try to work on better docs over christmas. We do have a
> good Wiki though: http://wiki.eclipse.org/CDO and it would be so great
> if more users who mastered the initial challenges would write
> tutorials and add them to the wiki. It'd be an invaluable contribution
> and save me time to add cool new functions like branching and an
> offline mode.
>
>>
>> My next step is to set up the server and example code. I am sure this
>> experience will be illuminate much.
> There are several wiki articles describing possible setups of a
> repository server. Have fun ;-)
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>


Re: [CDO] Walking the graph of a revision [message #502785 is a reply to message #502611] Wed, 09 December 2009 17:00 Go to previous message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
Eike,

Thanks for the reply and for your understanding that my criticism was definitely meant to be constructive. I will see what I can do to journal my exploration into CDO with an aim towards providing assistance to those who follow.

> Why should it be a *new* audit view? You have already one.

Let's let this question rest until I understand the system better. I will likely find out that it is superfluous, if not I will raise it again more intelligently.

Cheers,
Joel
Previous Topic:Accessing EMF model through java
Next Topic:How do I model a statically defined constant?
Goto Forum:
  


Current Time: Sat Nov 23 02:49:47 GMT 2019

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

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

Back to the top