Home » Modeling » EMF » [CDO] Do a rollback only for one resource
[CDO] Do a rollback only for one resource [message #1023891] |
Mon, 25 March 2013 11:49 |
Marc Gil Messages: 81 Registered: July 2009 |
Member |
|
|
Hi,
I wonder if it's possible to do a rollback only for one CDOResource, not for all the CDOTransaction.
The reason to do that, is the following: you can be working on several resources of the same transaction at the same time. But you close an editor and when you're prompt about saving the resource, you click NO. Then, you can continue working on the other editors, and when you save any of them, the changes done in the closed editor, are commited too.
I want to do a rollback only of the resource of the closed editor. I tried to do a reload of this resource, but it doesn't work. The map of dirty objects of the transaction, always contains the modified elements of this resource.
Is it possible to do that?
Thanks!
Marc Gil
|
|
|
Re: [CDO] Do a rollback only for one resource [message #1023915 is a reply to message #1023891] |
Mon, 25 March 2013 13:03 |
Ed Merks Messages: 33107 Registered: July 2009 |
Senior Member |
|
|
I don't think so. If such changes are completely unrelated, you could do
them with separate transactions and then you'd have what you wanted.
On 25/03/2013 7:49 AM, Marc Gil wrote:
> Hi,
>
> I wonder if it's possible to do a rollback only for one CDOResource,
> not for all the CDOTransaction.
>
> The reason to do that, is the following: you can be working on several
> resources of the same transaction at the same time. But you close an
> editor and when you're prompt about saving the resource, you click NO.
> Then, you can continue working on the other editors, and when you save
> any of them, the changes done in the closed editor, are commited too.
>
> I want to do a rollback only of the resource of the closed editor. I
> tried to do a reload of this resource, but it doesn't work. The map of
> dirty objects of the transaction, always contains the modified
> elements of this resource.
>
> Is it possible to do that?
>
> Thanks!
> Marc Gil
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [CDO] Do a rollback only for one resource [message #1031010 is a reply to message #1023891] |
Mon, 01 April 2013 04:03 |
|
Hi Marc,
Sorry for the late reply, I've just returned from the EclipseCon in Boston.
I agree with Ed, the changes are either unrelated and then they should be done with separate transactions. Or they are
related, then they can't be rolled back separately anyway.
Most CDO operations always relate to an entire repository to ensure referential integrity. One of the few exceptions is
CDOTransaction.setCommittables(Set<? extends EObject>), where you can set a subset of the changed objects to be
committed. This subset is checked for consistency before commit.
A similar thing could be done for rollback, but you'd have to contribute a respective patch.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 25.03.2013 12:49, schrieb Marc Gil:
> Hi,
>
> I wonder if it's possible to do a rollback only for one CDOResource, not for all the CDOTransaction.
>
> The reason to do that, is the following: you can be working on several resources of the same transaction at the same
> time. But you close an editor and when you're prompt about saving the resource, you click NO. Then, you can continue
> working on the other editors, and when you save any of them, the changes done in the closed editor, are commited too.
>
> I want to do a rollback only of the resource of the closed editor. I tried to do a reload of this resource, but it
> doesn't work. The map of dirty objects of the transaction, always contains the modified elements of this resource.
>
> Is it possible to do that?
>
> Thanks!
> Marc Gil
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| |
Goto Forum:
Current Time: Tue Mar 19 01:31:37 GMT 2024
Powered by FUDForum. Page generated in 0.02325 seconds
|