You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Markus Reich <ma...@markusreich.at> on 2013/04/24 20:37:56 UTC
Revert object changes without rollback
Hi,
is it possible to revert changes of an object? I don't want to use rollback
because changes of other objects shouldn't be reverted?
I know about child contexts, but my problem is, i select a collection of
object, and change them in a differnt UI view and in this view I want to
revert the changes?
Is it possible to create a child context and move an object from one
context to another (child) context?
Meex
Re: Revert object changes without rollback
Posted by Markus Reich <ma...@markusreich.at>.
I found a hint in the cayenne homepage for moving an object from one
context to another, this seems to solve my problems :-)
2013/4/25 Mike Kienenberger <mk...@gmail.com>
> Rollback works against a context. It rolls back all of the changes
> in that context since the last commit of that context.
>
> Depending on how you use it, most of the time you probably won't even
> bother to roll back changes -- you just allow the context to be
> garbage-collected and create a new one.
>
>
> If you want to work on a subset of the objects in your context, then
> yes, you will probably want to create a child context of that context
> and work with a copy of the object in the child context.
>
>
> On Wed, Apr 24, 2013 at 2:37 PM, Markus Reich
> <ma...@markusreich.at> wrote:
> > Hi,
> >
> > is it possible to revert changes of an object? I don't want to use
> rollback
> > because changes of other objects shouldn't be reverted?
> > I know about child contexts, but my problem is, i select a collection of
> > object, and change them in a differnt UI view and in this view I want to
> > revert the changes?
> > Is it possible to create a child context and move an object from one
> > context to another (child) context?
> >
> > Meex
>
--
*Markus Reich*
Moosbach 28/2
6392 St. Jakob i.H.
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at
Re: Revert object changes without rollback
Posted by Mike Kienenberger <mk...@gmail.com>.
Rollback works against a context. It rolls back all of the changes
in that context since the last commit of that context.
Depending on how you use it, most of the time you probably won't even
bother to roll back changes -- you just allow the context to be
garbage-collected and create a new one.
If you want to work on a subset of the objects in your context, then
yes, you will probably want to create a child context of that context
and work with a copy of the object in the child context.
On Wed, Apr 24, 2013 at 2:37 PM, Markus Reich
<ma...@markusreich.at> wrote:
> Hi,
>
> is it possible to revert changes of an object? I don't want to use rollback
> because changes of other objects shouldn't be reverted?
> I know about child contexts, but my problem is, i select a collection of
> object, and change them in a differnt UI view and in this view I want to
> revert the changes?
> Is it possible to create a child context and move an object from one
> context to another (child) context?
>
> Meex