Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Method cdoSession.openAudit()
[CDO] Method cdoSession.openAudit() [message #729552] Mon, 26 September 2011 13:34 Go to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

According to this documentation:

http://wiki.eclipse.org/CDO/Client#Audit_Views

I should be able to recover historical data for a CDOObject using the method CDOSession.openAudit(...)

It seems to me that this method is not available (my version of CDO is: CDO Model Repository Server 4.0.0.v20110831-1303, CDO Model Repository Client 4.0.0.v20110831-1303). Is that a feature of 4.0.1 or a feature removed or I am just simply wrong?

I would like to know which versions of a CDOObject (and in particular of a CDOResource) are available on the repository and then be able to retrieve them one by one.

Moreover I do not understand why my client retrieve from a CDO Repository CDOObjects which have no revision (cdoObject.cdoRevision returns null). I do not know if it matters but my Repository is configured to support audits.

Sorry for the newbie questions Smile

Federico


Re: [CDO] Method cdoSession.openAudit() [message #729654 is a reply to message #729552] Mon, 26 September 2011 16:57 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Federico,

I'm sorry that the wiki article is not up to date. In fact it refers to CDO version before 3.0. I've updated the
respective section now.

As of CDO 3.0 the functionality of audit views has been integrated into the normal read-only views (CDOView). Yu can
either pass the target time in the CDOSession.openView(...) call or switch it any time later via view.setTimeStamp() or
view.setBranchPoint().

Cheers
/Eike

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



Am 26.09.2011 15:34, schrieb Federico Tomassetti:
> According to this documentation:
>
> http://wiki.eclipse.org/CDO/Client#Audit_Views
>
> I should be able to recover historical data for a CDOObject using the method CDOSession.openAudit(...)
>
> It seems to me that this method is not available (my version of CDO is: CDO Model Repository Server
> 4.0.0.v20110831-1303, CDO Model Repository Client 4.0.0.v20110831-1303). Is that a feature of 4.0.1 or a feature
> removed or I am just simply wrong?
>
> I would like to know which versions of a CDOObject (and in particular of a CDOResource) are available on the
> repository and then be able to retrieve them one by one.
>
> Moreover I do not understand why my client retrieve from a CDO Repository CDOObjects which have no revision
> (cdoObject.cdoRevision returns null). I do not know if it matters but my Repository is configured to support audits.
>
> Sorry for the newbie questions :)
>
> Federico


Re: [CDO] Method cdoSession.openAudit() [message #729655 is a reply to message #729552] Mon, 26 September 2011 17:06 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Federico,

I hit "Send" too early. More comments below...



Am 26.09.2011 15:34, schrieb Federico Tomassetti:
> According to this documentation:
>
> http://wiki.eclipse.org/CDO/Client#Audit_Views
>
> I should be able to recover historical data for a CDOObject using the method CDOSession.openAudit(...)
>
> It seems to me that this method is not available (my version of CDO is: CDO Model Repository Server
> 4.0.0.v20110831-1303, CDO Model Repository Client 4.0.0.v20110831-1303). Is that a feature of 4.0.1 or a feature
> removed or I am just simply wrong?
>
> I would like to know which versions of a CDOObject (and in particular of a CDOResource) are available on the
> repository and then be able to retrieve them one by one.
There are generally two different ways to access historical data:

a) The high-level way is to open an (audit) view and get access to a consistent EMF model graph as it was valid at that
time.
b) The low-level way is to use the revision manager of the session to access the CDORevisions directly. They are similar
to EObjects but identical. Usually this way is adequate for add-on tools like history UIs or thelike.

Sometimes it's convenient to combine both approaches, e.g. take one CDOObject from a view, use the revision manager to
find out when it has been modified over time and then open additional audit views that target these times.

>
> Moreover I do not understand why my client retrieve from a CDO Repository CDOObjects which have no revision
> (cdoObject.cdoRevision returns null). I do not know if it matters but my Repository is configured to support audits.
That is normal with the lazy loading behaviour of CDO. If you look at the object's CDOState you'll probably see that
they're in state PROXY. Their underlying CDORevisions will be transparently loaded when they're needed.

Cheers
/Eike

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


Re: [CDO] Method cdoSession.openAudit() [message #729872 is a reply to message #729655] Tue, 27 September 2011 07:42 Go to previous messageGo to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

Thank you Eike.

How to use views to get "snapshots" from previous states is now clear I have still some problems using the RevisionManager.

Suppose that I want to get a list of all the revision of a given Resource (i.e. the revisions that contains changes to that Resource). I should use the method?
cdoSession.getRevisionManager().getRevision(resource.cdoid(), branchPoint, referenceChunk, prefetchDepth, loadOnDemand)

Which parameters should I use? What does referenceChunk and prefetchDepth mean?


Re: [CDO] Method cdoSession.openAudit() [message #729915 is a reply to message #729872] Tue, 27 September 2011 09:27 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 27.09.2011 09:42, schrieb Federico Tomassetti:
> Thank you Eike.
>
> How to use views to get "snapshots" from previous states is now clear I have still some problems using the
> RevisionManager.
>
> Suppose that I want to get a list of all the revision of a given Resource (i.e. the revisions that contains changes to
> that Resource). I should use the method?
Not sure but there may be one or two more misunderstandings:

a) In CDO the meaning of a revision is not the same as with, e.g., SVN. A CDORevision captures the *state* of a single
object for a certain period of time in a particular branch. It is not a change set.

b) A CDOResource is in almost no way "more special" than any other type of CDOObject. In particular there is no way to
determine a change set that only contains changes to the recusive contents of a resource (or any other type of object).

Change sets do exist in CDO. They comprise information such as the revisions of new objects, the revision deltas of
changed objects and the IDs of deleted objects. Their most prominent form is a CDOCommitInfo, other forms result from
compares or merges. Please note that their "scope" is always the entire repository (see b).

If the used IStore supports capturing the commit infos (e.g. DBStore) then you can use the commit info manager of your
session to query the commit infos.

>
> cdoSession.getRevisionManager().getRevision(resource.cdoid(), branchPoint, referenceChunk, prefetchDepth, loadOnDemand)
CDOUtil.getRevisionByVersion(CDOObject, int) is a simpler convenience method for this purpose ;-)


Cheers
/Eike

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


Previous Topic:[CDO] Deleting a resource from the database
Next Topic:Derived attributes for cross references?
Goto Forum:
  


Current Time: Sat Apr 20 01:07:22 GMT 2024

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

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

Back to the top