Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDORevision.getRevised() with MEMStore
[CDO] CDORevision.getRevised() with MEMStore [message #428865] Wed, 01 April 2009 10:15 Go to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
I'm using MEMStore, with SUPPORTING_AUDITS set to "true".
CDOObject.cdoRevision().getRevised() always returns 0, while
getCreated() returns the timestamp of creation. Do I misunderstand the
meaning of revised? Or does the MEMStore neither support the timestamp
of last modification nor audits at all?

Kind regards, Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428869 is a reply to message #428865] Wed, 01 April 2009 11:01 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Sebastian Paul wrote:

> Hi,
Hi Sebastien,

> I'm using MEMStore, with SUPPORTING_AUDITS set to "true".
> CDOObject.cdoRevision().getRevised() always returns 0, while
> getCreated() returns the timestamp of creation. Do I misunderstand the
> meaning of revised? Or does the MEMStore neither support the timestamp
> of last modification nor audits at all?
You will need to use an CDOAudit object to aaccess older
version.(session.openAudit(timestamp)) If you use CDOView or
CDOTransaction, you will always have the latest CDORevision , this means
getRevised will return 0.

Is this help you ?

> Kind regards, Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428875 is a reply to message #428869] Wed, 01 April 2009 11:25 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
>> I'm using MEMStore, with SUPPORTING_AUDITS set to "true".
>> CDOObject.cdoRevision().getRevised() always returns 0, while
>> getCreated() returns the timestamp of creation. Do I misunderstand
>> the meaning of revised? Or does the MEMStore neither support the
>> timestamp of last modification nor audits at all?
> You will need to use an CDOAudit object to aaccess older
> version.(session.openAudit(timestamp)) If you use CDOView or
> CDOTransaction, you will always have the latest CDORevision , this
> means getRevised will return 0.
>
> Is this help you ?
Yes that clearifies. Does this mean I cannot determine the timestamp of
last modification within a transaction?

Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428880 is a reply to message #428875] Wed, 01 April 2009 12:32 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Sebastian Paul wrote:


>>> I'm using MEMStore, with SUPPORTING_AUDITS set to "true".
>>> CDOObject.cdoRevision().getRevised() always returns 0, while
>>> getCreated() returns the timestamp of creation. Do I misunderstand
>>> the meaning of revised? Or does the MEMStore neither support the
>>> timestamp of last modification nor audits at all?
>> You will need to use an CDOAudit object to aaccess older
>> version.(session.openAudit(timestamp)) If you use CDOView or
>> CDOTransaction, you will always have the latest CDORevision , this
>> means getRevised will return 0.
>>
>> Is this help you ?
> Yes that clearifies. Does this mean I cannot determine the timestamp of
> last modification within a transaction?
We thought about that as well.
You can use CDOTransaction.getlastCommit(). But do not forget this will
give you only the last commit for that object (transaction).

TO have the last timestamp of all remote transaction you could listen to
CDOViewInvalidationEvent from a CDOView/CDOTransaction.

view.addListener();
public void notifyEvent(IEvent event)
{
if (event instanceof CDOViewInvalidationEvent)
{
CDOViewInvalidationEvent e = (CDOViewInvalidationEvent)event;
e.getTimeStamp()
}
}



Simon

> Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428886 is a reply to message #428880] Wed, 01 April 2009 13:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Guys,

In views and transactions the time stamp of the last modification of an
object is always object.cdoRevision().getCreated().

Cheers
/Eike

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



Simon Mc Duff schrieb:
> Sebastian Paul wrote:
>
>
>>>> I'm using MEMStore, with SUPPORTING_AUDITS set to "true".
>>>> CDOObject.cdoRevision().getRevised() always returns 0, while
>>>> getCreated() returns the timestamp of creation. Do I misunderstand
>>>> the meaning of revised? Or does the MEMStore neither support the
>>>> timestamp of last modification nor audits at all?
>>> You will need to use an CDOAudit object to aaccess older
>>> version.(session.openAudit(timestamp)) If you use CDOView or
>>> CDOTransaction, you will always have the latest CDORevision , this
>>> means getRevised will return 0.
>>>
>>> Is this help you ?
>> Yes that clearifies. Does this mean I cannot determine the timestamp
>> of last modification within a transaction?
> We thought about that as well.
> You can use CDOTransaction.getlastCommit(). But do not forget this
> will give you only the last commit for that object (transaction).
>
> TO have the last timestamp of all remote transaction you could listen
> to CDOViewInvalidationEvent from a CDOView/CDOTransaction.
>
> view.addListener();
> public void notifyEvent(IEvent event)
> {
> if (event instanceof CDOViewInvalidationEvent)
> {
> CDOViewInvalidationEvent e = (CDOViewInvalidationEvent)event;
> e.getTimeStamp()
> }
> }
>
>
>
> Simon
>
>> Sebastian
>
>


Re: [CDO] CDORevision.getRevised() with MEMStore [message #428890 is a reply to message #428886] Wed, 01 April 2009 13:38 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Eike Stepper wrote:
> In views and transactions the time stamp of the last modification of
> an object is always object.cdoRevision().getCreated().
Ah, that makes sense. So, how would I retrieve the timestamp of initial
creation? I guess, getCreated() on the first CDORevision, and it won't
work with disabled audits?

Then, whats the exact meaning of getRevised() in past revisions?

Kind regards, Sebastian

p.s.: Sorry for asking so much, but the javadoc lacks some details ;)
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428896 is a reply to message #428890] Wed, 01 April 2009 14:11 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Sebastian Paul wrote:

> Eike Stepper wrote:
>> In views and transactions the time stamp of the last modification of
>> an object is always object.cdoRevision().getCreated().
> Ah, that makes sense. So, how would I retrieve the timestamp of initial
> creation? I guess, getCreated() on the first CDORevision, and it won't
> work with disabled audits?

> Then, whats the exact meaning of getRevised() in past revisions?
getRevised is for previous version: here an example for the same object at
different version:

Object A : Version=1, created=30, revised 39
Object A : Version=2, created=40, revised 456
Object A : Version=3, created=457, revised 0

revised always equal the nextversion.created - 1. If it is the last one it
is equal to 0.

Maybe Eike will correct me again! :-)

Simon

> Kind regards, Sebastian

> p.s.: Sorry for asking so much, but the javadoc lacks some details ;)
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428897 is a reply to message #428890] Wed, 01 April 2009 14:13 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Oh yeah, About the documentation. Eike is trying to have a complete
documentation for CDO ready for Galileo!

The documentation will be there --> See
http://www.eclipse.org/cdo/documentation/manual_20.php
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428905 is a reply to message #428897] Wed, 01 April 2009 15:21 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Simon Mc Duff wrote:
> Oh yeah, About the documentation. Eike is trying to have a complete
> documentation for CDO ready for Galileo!
>
> The documentation will be there --> See
> http://www.eclipse.org/cdo/documentation/manual_20.php
>
Yap I had a look on it. Now I know everything about tool boxes and how
to change the oil. My car wants oil every 1000 km, if someone's
interested :D

Regards, Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428906 is a reply to message #428905] Wed, 01 April 2009 15:28 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Sebastian Paul wrote:

> Simon Mc Duff wrote:
>> Oh yeah, About the documentation. Eike is trying to have a complete
>> documentation for CDO ready for Galileo!
>>
>> The documentation will be there --> See
>> http://www.eclipse.org/cdo/documentation/manual_20.php
>>
> Yap I had a look on it. Now I know everything about tool boxes and how
> to change the oil. My car wants oil every 1000 km, if someone's
> interested :D

Funny guy! Like I said it is in progress !! :-)


> Regards, Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428913 is a reply to message #428890] Wed, 01 April 2009 17:27 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040007090500070306010302
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Sebastian Paul schrieb:
> Eike Stepper wrote:
>> In views and transactions the time stamp of the last modification of
>> an object is always object.cdoRevision().getCreated().
> Ah, that makes sense. So, how would I retrieve the timestamp of
> initial creation? I guess, getCreated() on the first CDORevision,
Yes.
> and it won't work with disabled audits?
If you want to access older revisions of a given object you don't
necessarily need to use audit views. You could use the revision manager
of the session directly:

| CDOObject object = ???;
*int *version = 1;
CDORevision revision = object.cdoRevision();
*if *(revision.getVersion() != version)
{
revision = session.getRevisionManager().getRevisionByVersion(object.cdo ID(), 0, version);
}

*long *initialCreation = revision.getCreated();|


If you file a bugzilla we can add a utility method to CDOUtil like this:

public static CDORevision getRevisionByVersion(CDOObject object, int
version);

Cheers
/Eike

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



--------------040007090500070306010302
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sebastian Paul schrieb:
<blockquote cite="mid:gqvqof$ad7$1@build.eclipse.org" type="cite">Eike
Stepper wrote:
<br>
<blockquote type="cite">In views and transactions the time stamp of
the last modification of an object is always
object.cdoRevision().getCreated().
<br>
</blockquote>
Ah, that makes sense. So, how would I retrieve the timestamp of initial
creation? I guess, getCreated() on the first CDORevision, </blockquote>
Yes.<br>
<blockquote cite="mid:gqvqof$ad7$1@build.eclipse.org" type="cite">and
it won't work with disabled audits?
<br>
</blockquote>
If you want to access older revisions of a given object you don't
necessarily need to use audit views. You could use the revision manager
of the session directly:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">


Re: [CDO] CDORevision.getRevised() with MEMStore [message #428926 is a reply to message #428913] Thu, 02 April 2009 06:53 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Eike Stepper wrote:
> Sebastian Paul schrieb:
>> and it won't work with disabled audits?
> If you want to access older revisions of a given object you don't
> necessarily need to use audit views. You could use the revision
> manager of the session directly:
> ...
But it won't work with disabled audits?
> If you file a bugzilla we can add a utility method to CDOUtil like this:
>
> public static CDORevision getRevisionByVersion(CDOObject object,
> int version);
Yes this is reasonable.

Sebastian
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428927 is a reply to message #428926] Thu, 02 April 2009 07:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Sebastian Paul schrieb:
> Eike Stepper wrote:
>> Sebastian Paul schrieb:
>>> and it won't work with disabled audits?
>> If you want to access older revisions of a given object you don't
>> necessarily need to use audit views. You could use the revision
>> manager of the session directly:
>> ...
> But it won't work with disabled audits?
No, if old revisions are not stored by the store they an not be queried.

>> If you file a bugzilla we can add a utility method to CDOUtil like this:
>>
>> public static CDORevision getRevisionByVersion(CDOObject object,
>> int version);
> Yes this is reasonable.
Does that mean you filed a bugzilla? ;-)

Cheers
/Eike

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


Re: [CDO] CDORevision.getRevised() with MEMStore [message #428929 is a reply to message #428927] Thu, 02 April 2009 08:06 Go to previous message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Eike Stepper wrote:
>>> If you file a bugzilla we can add a utility method to CDOUtil like
>>> this:
>>>
>>> public static CDORevision getRevisionByVersion(CDOObject object,
>>> int version);
>> Yes this is reasonable.
> Does that mean you filed a bugzilla? ;-)
Seems like that: https://bugs.eclipse.org/bugs/show_bug.cgi?id=270926
;)

Regards, Sebastian
Previous Topic:[CDO] Installing CDO 2 & EMF 2.5 Help Required
Next Topic:EPackage.Registry concurrency issues
Goto Forum:
  


Current Time: Sat Apr 27 01:18:22 GMT 2024

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

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

Back to the top