deleted entity passed to persist:

Jesus M. Rodriguez jmrodri at gmail.com
Tue Mar 23 03:50:28 UTC 2010


On Mon, Mar 22, 2010 at 8:17 PM, Adam Young <ayoung at redhat.com> wrote:
> If you see the above error, it seems to mean that a delete is violating
> a constraint.
>
> I got this exception with the following code:
>
>     @DELETE
>     @Path("/{dbid}")
>     public void unbind(@PathParam("dbid") Long dbid) {
>
>         Entitlement toDelete = entitlementCurator.find(dbid);
>         if (toDelete != null) {
>             //toDelete.getConsumer().getEntitlements().remove(toDelete);
>             entitlementCurator.delete(toDelete);
>             return;
>         }
>         throw new NotFoundException(
>             "Entitlement with ID '" + dbid + "' could not be found");
>     }
>
>
>
> To get rid of the error, uncomment out the line //toDelete...

But won't that load ALL of the consumers entitlements just to delete it?

Sincerely,
jesus



More information about the candlepin mailing list