Home » Modeling » EMF » [CDO] Temporality + fine grained access control
|
Re: [CDO] Temporality + fine grained access control [message #503940 is a reply to message #503924] |
Wed, 16 December 2009 15:04 |
|
Hi Ewan,
Comments below...
Evan Linwood schrieb:
> Hi Eike,
>
> I've been interested in what has become of the EMFT Temporality project,
I cc'ed Jean-Claude and Simon (his collegue) for this question. In case
it's inactive we should consider to archive it. I cc'ed Ed for this issue.
> but have heard that CDO possibly supports temporality directly as well.
Yes, CDO can transparently version the overall object graph and make
historical versions available as a consitent whole (CDOObject graph, use
a CDOAudit view) or provide former CDORevisions of single objects (use
CDORevisionManager).
>
> Certainly direct support within CDO for this would be terrific.
> I've attempted to search further on this but haven't had much luck as
> yet.
See above ;-)
>
> Just to mention a little more of what the Temporality incubator
> project was trying to achieve - basically it went beyond either the
> JPA @Temporal annotation and/or the EMF ChangerRecorder capability to
> allow versioned copies of objects to be retained in the data store
> such that queries could be made to directly return the state of an
> object(s) at a specified point in time, without needing to navigate
> through a chain of update/change events to reconstruct this.
You can use CDOQueries to query the graph at a certain (record) time.
I'm generally against mixing objects of different times (commit
operations) in a single view.
>
> Sorry but one other quick question for you - can I ask whether you
> know of any work with regard to implementation of hierarchical fine
> grained access control schemes using CDO?
There is https://bugs.eclipse.org/bugs/show_bug.cgi?id=277075 but it
seems a bit stalled since May.
> I understand the challenges associated with getting this to work
> efficiently when using an RDBMS based data store, and have been
> looking at transitive closure based solutions to avoid the need to
> load objects prior to being able to determine effective access rights
> etc.
> I thought I should check whether there was anything to be aware of in
> the CDO space regarding this.
You're welcome to comment or work on the aforementioned bugzilla ;-)
Cheers
/Eike
----
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] Temporality + fine grained access control [message #503956 is a reply to message #503940] |
Wed, 16 December 2009 15:49 |
|
Hi Eike,
Could you please expound on your comment. I am not clear on what you are getting at, but I have a gut feeling that it will be important to me with ORMF when I do undertand
Thanks,
Joel
Eike Stepper wrote on Wed, 16 December 2009 15:04 |
> Just to mention a little more of what the Temporality incubator
> project was trying to achieve - basically it went beyond either the
> JPA @Temporal annotation and/or the EMF ChangerRecorder capability to
> allow versioned copies of objects to be retained in the data store
> such that queries could be made to directly return the state of an
> object(s) at a specified point in time, without needing to navigate
> through a chain of update/change events to reconstruct this.
You can use CDOQueries to query the graph at a certain (record) time.
I'm generally against mixing objects of different times (commit
operations) in a single view.
|
|
|
|
Re: [CDO] Temporality + fine grained access control [message #503967 is a reply to message #503956] |
Wed, 16 December 2009 11:08 |
|
Joel Rosi-Schwartz schrieb:
> Hi Eike,
>
> Could you please expound on your comment. I am not clear on what you
> are getting at, but I have a gut feeling that it will be important to
> me with ORMF when I do undertand ;)
Which part of my comment are you referring to, or what exactly would you
like me to elaborate on?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Thanks,
> Joel
>
> Eike Stepper wrote on Wed, 16 December 2009 15:04
>> > Just to mention a little more of what the Temporality incubator
>> > project was trying to achieve - basically it went beyond either the
>> > JPA @Temporal annotation and/or the EMF ChangerRecorder capability to
>> > allow versioned copies of objects to be retained in the data store
>> > such that queries could be made to directly return the state of an
>> > object(s) at a specified point in time, without needing to navigate
>> > through a chain of update/change events to reconstruct this.
>> You can use CDOQueries to query the graph at a certain (record) time.
>> I'm generally against mixing objects of different times (commit
>> operations) in a single view.
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Temporality + fine grained access control [message #503971 is a reply to message #503967] |
Wed, 16 December 2009 16:17 |
|
Eike,
You stated
Quote: |
You can use CDOQueries to query the graph at a certain (record) time.
I'm generally against mixing objects of different times (commit
operations) in a single view.
|
I do not understand what you mean by "mixing objects of different times". I thought that when a query is performed for time "t" that all object are returned with the state they held at time "t". So I am basically confused as why you are bringing "different times (commit operations)" into the conversation. Sorry, I'm a but lost here
Joel
Eike Stepper wrote on Wed, 16 December 2009 11:08 | Joel Rosi-Schwartz schrieb:
> Hi Eike,
>
> Could you please expound on your comment. I am not clear on what you
> are getting at, but I have a gut feeling that it will be important to
> me with ORMF when I do undertand
Which part of my comment are you referring to, or what exactly would you
like me to elaborate on?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Thanks,
> Joel
>
> Eike Stepper wrote on Wed, 16 December 2009 15:04
>> > Just to mention a little more of what the Temporality incubator
>> > project was trying to achieve - basically it went beyond either the
>> > JPA @Temporal annotation and/or the EMF ChangerRecorder capability to
>> > allow versioned copies of objects to be retained in the data store
>> > such that queries could be made to directly return the state of an
>> > object(s) at a specified point in time, without needing to navigate
>> > through a chain of update/change events to reconstruct this.
>> You can use CDOQueries to query the graph at a certain (record) time.
>> I'm generally against mixing objects of different times (commit
>> operations) in a single view.
>
>
|
|
|
|
Re: [CDO] Temporality + fine grained access control [message #503993 is a reply to message #503971] |
Wed, 16 December 2009 18:10 |
|
Joel Rosi-Schwartz schrieb:
> Eike,
>
> You stated
>
> Quote:
>> You can use CDOQueries to query the graph at a certain (record) time.
>> I'm generally against mixing objects of different times (commit
>> operations) in a single view.
>
>
> I do not understand what you mean by "mixing objects of different
> times". I thought that when a query is performed for time "t" that all
> object are returned with the state they held at time "t". So I am
> basically confused as why you are bringing "different times (commit
> operations)" into the conversation. Sorry, I'm a but lost here :(
Possibly a misunderstanding, but you started the thread with this:
"...
such that queries could be made to directly return the state of an object(s) at a specified point in time,
...."
I just wanted to point out that not the query should give a time
parameter, but rather the view that provided the query, so that all
objects returned by the query are valid at that time of the view.
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Joel
>
> Eike Stepper wrote on Wed, 16 December 2009 11:08
>> Joel Rosi-Schwartz schrieb:
>> > Hi Eike,
>> >
>> > Could you please expound on your comment. I am not clear on what you
>> > are getting at, but I have a gut feeling that it will be important to
>> > me with ORMF when I do undertand ;)
>> Which part of my comment are you referring to, or what exactly would you
>> like me to elaborate on?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>> >
>> > Thanks,
>> > Joel
>> >
>> > Eike Stepper wrote on Wed, 16 December 2009 15:04
>> >> > Just to mention a little more of what the Temporality incubator
>> >> > project was trying to achieve - basically it went beyond either the
>> >> > JPA @Temporal annotation and/or the EMF ChangerRecorder
>> capability to
>> >> > allow versioned copies of objects to be retained in the data store
>> >> > such that queries could be made to directly return the state of an
>> >> > object(s) at a specified point in time, without needing to navigate
>> >> > through a chain of update/change events to reconstruct this.
>> >> You can use CDOQueries to query the graph at a certain (record) time.
>> >> I'm generally against mixing objects of different times (commit
>> >> operations) in a single view.
>> >
>> >
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| |
Re: [CDO] Temporality + fine grained access control [message #506082 is a reply to message #504064] |
Tue, 05 January 2010 21:26 |
Evan2 Linwood2 Messages: 5 Registered: December 2009 |
Junior Member |
|
|
Hi Eike,
I've spent some time now building a couple of test cases around the audit versioning side of CDO, and have managed to get both some expected results and also a couple of things that I'm not sure are a reflection of my lack of understanding (probably likely at this stage!) or something else.
To give you some background, I'm working with a very simple model containing only a single object that has a self referencing 0..1 relationship.
I've developed a test case scenario in which I build a graph of related objects, and within the scope of three transaction commits, make a series of expected changes to the graph and record the getLastCommitTime associated with each transaction. No objects are removed at any point.
I then access the graph structure via Audit views, using each of the saved commit times, and then check that the graph structure is as expected at each commit point time.
What I'm finding is that when I reference the objects by iterating over auditview.resource.getContents.get(x), I see the expected result precisely in terms of which objects are present in which audit view, and in terms of the expected relationship between objects. So clearly the underlying mechanism is working (which is fantastic !
My issue is that when I execute a very simple SQL based CDOQuery at the first commit point time, the result set size() returned is equal to the total number of objects created across the three commit operations, plus the number of modifications made to existing objects.
I'm assuming therefore that the query is returning all revisions of each object. I can see that something like this happening by inspecting the CDORevision.isCurrent() method on each object returned.
Where it gets confusing is that although the result set size returned by the CDOQuery.getResult.size() is 30, when i iterate through to item number 22, iterator.hasNext() returns true, but then iterator.next() throws the following exception:
cause: "ObjectNotFoundException (id=426)
detailMessage: "Object OID15 not found (temporary=false)" (id=430)
I've searched and read the items on the forum relating to CDO Query, but if you don't mind I still have a number of questions (I'm hoping to use CDOQuery rather than going to EMF or direct SQL):
- if the CDOQuery.getResult.size() returns 30, should I be able to access 30 objects cleanly (or should i expect to need to catch and interpret exceptions)?
- Otherwise, is there a proper way to use CDOQuery against an audit view that I'm missing, such that it is restricted in scope to just the desired point in time?
- Is it possible to support storage of references to specific object revisions? For example, an Order Line class that references configuration changes made to specific revisions of NetworkElements, such that future modification of an Order Line would not affect the specific revision of any referenced NetworkElements? (Or is it recommended to store the relevant timestamp with the parent object (such as an Order Line), and use this later to reference the appropriate object revisions?)
I"m also trying to understand these observations in the context of your comment in this thread regarding mixing objects of different times
Generally otherwise it's really great to see the audit revision capability working!
And also just one quick final question - is there a way to quickly delete the entire contents of a repository or resource, across all revisions?
Thanks very much
Evan
|
|
|
Re: [CDO] Temporality + fine grained access control [message #506128 is a reply to message #506082] |
Wed, 06 January 2010 05:02 |
|
This is a multi-part message in MIME format.
--------------080108090408080601000502
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Hi Evan,
Comments below...
Evan Linwood schrieb:
> Hi Eike,
> I've spent some time now building a couple of test cases around the
> audit versioning side of CDO, and have managed to get both some
> expected results and also a couple of things that I'm not sure are a
> reflection of my lack of understanding (probably likely at this
> stage!) or something else.
> To give you some background, I'm working with a very simple model
> containing only a single object that has a self referencing 0..1
> relationship.
>
> I've developed a test case scenario in which I build a graph of
> related objects, and within the scope of three transaction commits,
> make a series of expected changes to the graph and record the
> getLastCommitTime associated with each transaction. No objects are
> removed at any point.
>
> I then access the graph structure via Audit views, using each of the
> saved commit times, and then check that the graph structure is as
> expected at each commit point time.
>
> What I'm finding is that when I reference the objects by iterating
> over auditview.resource.getContents.get(x), I see the expected result
> precisely in terms of which objects are present in which audit view,
> and in terms of the expected relationship between objects. So clearly
> the underlying mechanism is working (which is fantastic ! :)
Great ;-)
>
> My issue is that when I execute a very simple SQL based CDOQuery at
> the first commit point time, the result set size() returned is equal
> to the total number of objects created across the three commit
> operations, plus the number of modifications made to existing objects.
> I'm assuming therefore that the query is returning all revisions of
> each object. I can see that something like this happening by
> inspecting the CDORevision.isCurrent() method on each object returned.
Yes, with SQL queries you need to understand the mapped DB schema and
make your queries aware of the temporality. You'll need to use
org.eclipse.emf.cdo.server.IQueryContext.getTimeStamp() somewhere.
>
> Where it gets confusing is that although the result set size returned
> by the CDOQuery.getResult.size() is 30, when i iterate through to item
> number 22, iterator.hasNext() returns true, but then iterator.next()
> throws the following exception:
>
> cause: "ObjectNotFoundException (id=426)
> detailMessage: "Object OID15 not found (temporary=false)" (id=430)
If your query returns IDs of objects that do not exist *at the time of
your audit view* this exception is to be expected.
>
> I've searched and read the items on the forum relating to CDO Query,
> but if you don't mind I still have a number of questions (I'm hoping
> to use CDOQuery rather than going to EMF or direct SQL):
>
> - if the CDOQuery.getResult.size() returns 30, should I be able to
> access 30 objects cleanly (or should i expect to need to catch and
> interpret exceptions)?
Not generally, see above.
> - Otherwise, is there a proper way to use CDOQuery against an audit
> view that I'm missing, such that it is restricted in scope to just the
> desired point in time?
Your SQL must mimic this code in AbstractCDORevision:
| *public **boolean *isValid(*long *timeStamp)
{
*return *(revised == UNSPECIFIED_DATE || revised >= timeStamp) && timeStamp >= created;
}|
Turn on tracing in your server and inspect the SQL queries created by
CDO when loading revisions from the DB.
> - Is it possible to support storage of references to specific object
> revisions?
No. The information which revision to select for a given target CDOID is
external to all objects, i.e. it's located in the CDOView/CDOAudit.
> For example, an Order Line class that references configuration changes
> made to specific revisions of NetworkElements, such that future
> modification of an Order Line would not affect the specific revision
> of any referenced NetworkElements? (Or is it recommended to store the
> relevant timestamp with the parent object (such as an Order Line), and
> use this later to reference the appropriate object revisions?)
That would be an option.
> I"m also trying to understand these observations in the context of
> your comment in this thread regarding mixing objects of different
> times :)
I don't recall exactly. Maybe it was related :P
>
> Generally otherwise it's really great to see the audit revision
> capability working!
Good to see that it's useful ;-)
>
> And also just one quick final question - is there a way to quickly
> delete the entire contents of a repository or resource, across all
> revisions?
No, there's currently no mechanism (in CDO) to delete revisions. They
can only be marked "revised" without having successor revisions. That
happens when you commit a transaction.
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Thanks very much :)
> Evan
--------------080108090408080601000502
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Evan,<br>
<br>
Comments below...<br>
<br>
<br>
Evan Linwood schrieb:
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
I've spent some time now building a couple of test cases around the
audit versioning side of CDO, and have managed to get both some
expected results and also a couple of things that I'm not sure are a
reflection of my lack of understanding (probably likely at this stage!)
or something else.
<br>
To give you some background, I'm working with a very simple model
containing only a single object that has a self referencing 0..1
relationship.
<br>
<br>
I've developed a test case scenario in which I build a graph of related
objects, and within the scope of three transaction commits, make a
series of expected changes to the graph and record the
getLastCommitTime associated with each transaction. No objects are
removed at any point.
<br>
<br>
I then access the graph structure via Audit views, using each of the
saved commit times, and then check that the graph structure is as
expected at each commit point time.
<br>
<br>
What I'm finding is that when I reference the objects by iterating over
auditview.resource.getContents.get(x), I see the expected result
precisely in terms of which objects are present in which audit view,
and in terms of the expected relationship between objects. So clearly
the underlying mechanism is working (which is fantastic ! :)
<br>
</blockquote>
Great ;-)<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite"><br>
My issue is that when I execute a very simple SQL based CDOQuery at the
first commit point time, the result set size() returned is equal to the
total number of objects created across the three commit operations,
plus the number of modifications made to existing objects. <br>
I'm assuming therefore that the query is returning all revisions of
each object. I can see that something like this happening by inspecting
the CDORevision.isCurrent() method on each object returned.
<br>
</blockquote>
Yes, with SQL queries you need to understand the mapped DB schema and
make your queries aware of the temporality. You'll need to use
org.eclipse.emf.cdo.server.IQueryContext.getTimeStamp() somewhere.<br>
<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite"><br>
Where it gets confusing is that although the result set size returned
by the CDOQuery.getResult.size() is 30, when i iterate through to item
number 22, iterator.hasNext() returns true, but then iterator.next()
throws the following exception:
<br>
<br>
cause: "ObjectNotFoundException (id=426)
<br>
detailMessage: "Object OID15 not found (temporary=false)" (id=430)
<br>
</blockquote>
If your query returns IDs of objects that do not exist *at the time of
your audit view* this exception is to be expected.<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite"><br>
I've searched and read the items on the forum relating to CDO Query,
but if you don't mind I still have a number of questions (I'm hoping to
use CDOQuery rather than going to EMF or direct SQL):
<br>
<br>
- if the CDOQuery.getResult.size() returns 30, should I be able to
access 30 objects cleanly (or should i expect to need to catch and
interpret exceptions)?
<br>
</blockquote>
Not generally, see above.<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite">-
Otherwise, is there a proper way to use CDOQuery against an audit view
that I'm missing, such that it is restricted in scope to just the
desired point in time?
<br>
</blockquote>
Your SQL must mimic this code in AbstractCDORevision:<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"> </font><font
color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font
color="#000000">isValid</font><font color="#000000">(</font><font
color="#7f0055"><b>long </b></font><font color="#000000">timeStamp</font><font
color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font
color="#000000">(</font><font color="#000000"> revised == UNSPECIFIED_DATE || revised >= timeS tamp </font><font
color="#000000">) </font><font color="#000000">&& timeStamp >= created; </font><br>
<font color="#ffffff"> </font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><br>
Turn on tracing in your server and inspect the SQL queries created by
CDO when loading revisions from the DB.<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite">- Is
it possible to support storage of references to specific object
revisions? </blockquote>
No. The information which revision to select for a given target CDOID
is external to all objects, i.e. it's located in the CDOView/CDOAudit.<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite">For
example, an Order Line class that references configuration changes made
to specific revisions of NetworkElements, such that future modification
of an Order Line would not affect the specific revision of any
referenced NetworkElements? (Or is it recommended to store the relevant
timestamp with the parent object (such as an Order Line), and use this
later to reference the appropriate object revisions?) <br>
</blockquote>
That would be an option.<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite">I"m
also trying to understand these observations in the context of your
comment in this thread regarding mixing objects of different times :)
<br>
</blockquote>
I don't recall exactly. Maybe it was related :P<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite"><br>
Generally otherwise it's really great to see the audit revision
capability working!
<br>
</blockquote>
Good to see that it's useful ;-)<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite"><br>
And also just one quick final question - is there a way to quickly
delete the entire contents of a repository or resource, across all
revisions? <br>
</blockquote>
No, there's currently no mechanism (in CDO) to delete revisions. They
can only be marked "revised" without having successor revisions. That
happens when you commit a transaction.<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<blockquote cite="mid:hi0sam$mk5$1@build.eclipse.org" type="cite"> <br>
Thanks very much :)
<br>
Evan
<br>
</blockquote>
</body>
</html>
--------------080108090408080601000502--
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| | | |
Goto Forum:
Current Time: Thu Mar 28 12:10:33 GMT 2024
Powered by FUDForum. Page generated in 0.03848 seconds
|