[jboss-user] [EJB 3.0] - Re: deleted entity passed to persist:

waynebaylor do-not-reply at jboss.com
Tue Oct 9 12:17:25 EDT 2007


looks like your deleting the ArticleSupplierPrice objects from the DB, but not removing ArticleSupplier's references to the objects.

maybe change your code to something like:

  | public void deleteSupplierDetails() 
  | {
  |     if (this.artSuppPriceList != null) 
  |     {
  |         ArticleSupplierPrice[] prices = this.artSuppPriceList.toArray(new ArticleSupplierPrice[0]);
  |         for(ArticleSupplierPrice price : prices)
  |         {
  |             if (price.getIsChecked() != null 
  |                     && price.getIsChecked().equals(Boolean.TRUE)) 
  |             {
  |                 this.atrSuppPriceList.remove(price); //remove reference cuz you're deleting it
  | 	        entityManager.remove(price);
  | 	    }
  |         }
  | 
  | 	entityManager.flush();
  |     }
  | }	
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093108#4093108

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093108



More information about the jboss-user mailing list