Page 1 of 1

Delete Product option is not working in Admin

Posted: Thu May 01, 2014 10:32 am
by ramesh_gpre
Hi,

The delete option in broadleaf admin is not working with 3.1.2 GA version. I get the below exception every time I try to delete any product:

[ERROR] 14:09:11 SqlExceptionHelper - Cannot delete or update a parent row: a foreign key constraint fails (`stylemycase`.`BLC_PRODUCT`, CONSTRAINT `FK5B95B7C96D386535` FOREIGN KEY (`DEFAULT_SKU_ID`) REFERENCES `BLC_SKU` (`SKU_ID`))
[ERROR] 14:09:11 DynamicEntityRemoteService - Problem removing org.broadleafcommerce.core.catalog.domain.Product
org.broadleafcommerce.common.exception.ServiceException: Problem removing entity : org.hibernate.exception.ConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`stylemycase`.`BLC_PRODUCT`, CONSTRAINT `FK5B95B7C96D386535` FOREIGN KEY (`DEFAULT_SKU_ID`) REFERENCES `BLC_SKU` (`SKU_ID`))
at org.broadleafcommerce.openadmin.server.service.persistence.module.BasicPersistenceModule.remove(BasicPersistenceModule.java:963)
at org.broadleafcommerce.openadmin.server.service.persistence.PersistenceManagerImpl.remove(PersistenceManagerImpl.java:644)
at org.broadleafcommerce.openadmin.server.service.DynamicEntityRemoteService$5.execute(DynamicEntityRemoteService.java:204)
at org.broadleafcommerce.openadmin.server.service.DynamicEntityRemoteService$5.execute(DynamicEntityRemoteService.java:199)
at org.broadleafcommerce.openadmin.server.service.persistence.PersistenceThreadManager.operation(PersistenceThreadManager.java:33)
at org.broadleafcommerce.openadmin.server.service.DynamicEntityRemoteService.remove(DynamicEntityRemoteService.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

Can some one please check?

Best Regards,
Ramesh

Re: Delete Product option is not working in Admin

Posted: Thu May 01, 2014 11:04 am
by phillipuniverse
This is because of foreign key constraints where the admin attempts to do hard-deletes everywhere in the admin. This is an outstanding feature report that we have fleshed out at https://github.com/BroadleafCommerce/Br ... issues/842.

Your specific error was reported in https://github.com/BroadleafCommerce/Br ... issues/790.