cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Deleting object in one-to-many relationship leaves transient
Date Thu, 23 Feb 2012 00:35:03 GMT
Hi Tad,

I always remove the object from the relationship (unlinking it) and
then delete it.  Try doing that instead of just deleting it.

mrg


On Wed, Feb 22, 2012 at 6:53 PM, Tad <tadfisher@gmail.com> wrote:
> We're using Cayenne in a web application. Our relationship is like this:
>
> root <- one-to-many -> children
>
> We make a POST request, loop through some objects, and delete some using
> ObjectContext.deleteObject. We then commit, no exceptions are thrown, and
> ObjectContext.uncommittedObjects is empty. The DB reflects these changes.
>
> We then redirect to a page that lists the remaining objects. However, when
> using the generated root.getChildrenArray() method, it returns a list that
> includes the objects which were just deleted. These objects are marked as
> transient.
>
> Is my understanding correct that we need to perform an explicit query in
> order to refresh this list, rather than using the generated getter?
>
> Thanks for any help.
>
> --
> Thanks,
> Tad

Mime
View raw message