Home » Modeling » EMF » [CDO] CDOID changes when CDOObject is moved - bug or not?
[CDO] CDOID changes when CDOObject is moved - bug or not? [message #431640] |
Mon, 20 July 2009 05:20 |
Caspar D. Messages: 35 Registered: July 2009 |
Member |
|
|
When a CDOObject is moved from one place in the graph to another, by means
of an either an EMF DragAndDropCommand, or, equivalently, a RemoveCommand
followed by an AddCommand, it gets assigned a new CDOID.
This is obviously a consequence of the state changes that are brought
about by this remove-then-add-back approach: the removal cycles the
object's state from CLEAN to TRANSIENT, and then the adding back cycles it
from TRANSIENT to NEW, which results in a new CDOID.
Not removing the object first, but just adding it elsewhere, avoids this
problem, but causes other problems: the RemoveCommand indeed serves a
definite purpose, as was recently pointed out to me by Ed in
http://bugs.eclipse.org/283527
So it seems that it's currently impossible to move a CDOObject around in
the graph, without changing its CDOID... does this make sense?
|
|
|
Re: [CDO] CDOID changes when CDOObject is moved - bug or not? [message #431641 is a reply to message #431640] |
Mon, 20 July 2009 06:21 |
|
Caspar,
As you figured out there is an essential difference in CDO between
1) moving an object within a persistent (attached) object graph
2) detach/reattach an object
Whenever an object is detached from the graph it looses all its
CDO-specific properties: id, state, view and revision.
Can you please explain why a conceptual move in your and Ed's opinion
must go through a remove?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Caspar De Groot schrieb:
> When a CDOObject is moved from one place in the graph to another, by
> means of an either an EMF DragAndDropCommand, or, equivalently, a
> RemoveCommand followed by an AddCommand, it gets assigned a new CDOID.
>
> This is obviously a consequence of the state changes that are brought
> about by this remove-then-add-back approach: the removal cycles the
> object's state from CLEAN to TRANSIENT, and then the adding back
> cycles it from TRANSIENT to NEW, which results in a new CDOID.
>
> Not removing the object first, but just adding it elsewhere, avoids
> this problem, but causes other problems: the RemoveCommand indeed
> serves a definite purpose, as was recently pointed out to me by Ed in
> http://bugs.eclipse.org/283527
>
> So it seems that it's currently impossible to move a CDOObject around
> in the graph, without changing its CDOID... does this make sense?
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 06:59:16 GMT 2024
Powered by FUDForum. Page generated in 0.03059 seconds
|