|
|
|
|
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428886 is a reply to message #428880] |
Wed, 01 April 2009 13:12 |
|
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
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [CDO] CDORevision.getRevised() with MEMStore [message #428896 is a reply to message #428890] |
Wed, 01 April 2009 14:11 |
Simon Mc Duff 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 #428913 is a reply to message #428890] |
Wed, 01 April 2009 17:27 |
|
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">
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03560 seconds