You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by John Huss <jo...@gmail.com> on 2013/10/08 23:45:52 UTC
Get (really) modified objects
After calling objectContext.commitChanges() need to be able to find out
what objects were actually changed by the commit. Since
objectContext.getModifiedObjects() includes phantom (noop) changes I can't
use that. I also preferably need have this info in the local scope
immediately after commit, not in an external callback or listener.
Is there a way to force the context to evaluate and discard noop changes
before committing maybe?
Thanks,
John
Re: Get (really) modified objects
Posted by Michael Gentry <mg...@masslight.net>.
I'll send it off-list.
On Tue, Oct 8, 2013 at 10:25 PM, John Huss <jo...@gmail.com> wrote:
> Sure, I'll give it a try. Thanks.
>
>
> On Tue, Oct 8, 2013 at 8:53 PM, Michael Gentry <mgentry@masslight.net
> >wrote:
>
> > Hi John,
> >
> > I have some utility methods that will return/print the list of truly
> > modified objects (discards phantoms). You can use that before you
> > commitChanges (you have to call newObjects/deletedObjects, too, if you
> care
> > about those). Let me know if that'll be sufficient and I'll dig it up
> for
> > you.
> >
> > mrg
> >
> > PS. I've only done moderate testing of it, so a second set of eyes
> wouldn't
> > hurt to verify it actually works correctly.
> >
> >
> >
> > On Tue, Oct 8, 2013 at 5:45 PM, John Huss <jo...@gmail.com> wrote:
> >
> > > After calling objectContext.commitChanges() need to be able to find out
> > > what objects were actually changed by the commit. Since
> > > objectContext.getModifiedObjects() includes phantom (noop) changes I
> > can't
> > > use that. I also preferably need have this info in the local scope
> > > immediately after commit, not in an external callback or listener.
> > >
> > > Is there a way to force the context to evaluate and discard noop
> changes
> > > before committing maybe?
> > >
> > > Thanks,
> > > John
> > >
> >
>
Re: Get (really) modified objects
Posted by John Huss <jo...@gmail.com>.
Sure, I'll give it a try. Thanks.
On Tue, Oct 8, 2013 at 8:53 PM, Michael Gentry <mg...@masslight.net>wrote:
> Hi John,
>
> I have some utility methods that will return/print the list of truly
> modified objects (discards phantoms). You can use that before you
> commitChanges (you have to call newObjects/deletedObjects, too, if you care
> about those). Let me know if that'll be sufficient and I'll dig it up for
> you.
>
> mrg
>
> PS. I've only done moderate testing of it, so a second set of eyes wouldn't
> hurt to verify it actually works correctly.
>
>
>
> On Tue, Oct 8, 2013 at 5:45 PM, John Huss <jo...@gmail.com> wrote:
>
> > After calling objectContext.commitChanges() need to be able to find out
> > what objects were actually changed by the commit. Since
> > objectContext.getModifiedObjects() includes phantom (noop) changes I
> can't
> > use that. I also preferably need have this info in the local scope
> > immediately after commit, not in an external callback or listener.
> >
> > Is there a way to force the context to evaluate and discard noop changes
> > before committing maybe?
> >
> > Thanks,
> > John
> >
>
Re: Get (really) modified objects
Posted by Michael Gentry <mg...@masslight.net>.
Hi John,
I have some utility methods that will return/print the list of truly
modified objects (discards phantoms). You can use that before you
commitChanges (you have to call newObjects/deletedObjects, too, if you care
about those). Let me know if that'll be sufficient and I'll dig it up for
you.
mrg
PS. I've only done moderate testing of it, so a second set of eyes wouldn't
hurt to verify it actually works correctly.
On Tue, Oct 8, 2013 at 5:45 PM, John Huss <jo...@gmail.com> wrote:
> After calling objectContext.commitChanges() need to be able to find out
> what objects were actually changed by the commit. Since
> objectContext.getModifiedObjects() includes phantom (noop) changes I can't
> use that. I also preferably need have this info in the local scope
> immediately after commit, not in an external callback or listener.
>
> Is there a way to force the context to evaluate and discard noop changes
> before committing maybe?
>
> Thanks,
> John
>