persistence@glassfish.java.net

Re: removing item from collection

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Wed, 05 Nov 2008 10:04:21 -0500

Are you sure you are removing the correct instance from the list of
designs? You example code uses "persistentDesign" and "design". Are
you sure you are merging the correct object into the Persistence Context?

--Gordon

polvo wrote:
> Hey, when I remove a design from a project, the relationship is deleted from
> the database but not from the persistence context - it still appears as part
> of the project unless I restart the server. What am I doing wrong?
>
>
> project.getDesigns().remove(persistentDesign);
> design.setProject(null);
> project = getDao().update(project);
> persistentDesignManager.updateDesign((PhotovoltaicGridTieSystemDesign)
> design);
>
> thx in advance.
>