After looking into ShipmentServices.java's removeShipmentEstimate method
which actually deletes the Shipping Estimate, it also try to delete the
related entity records from WeightQuantityBreak, QuantityQuantityBreak &
PriceQuantityBreak.

The Shipping Estimate which I configured for eCommerce was using the Weight
Break Id  "0 - 0 [RentalStore]" which is also being used by Open Travel
system store and that's why it couldn't delete because of foreign key
constraint.

Should the removeShipmentEstimate also delete the related entries from
QuantityBreak tables ?

- Abdullah

On Thu, Jan 28, 2010 at 1:12 PM, Abdullah Shaikh <
[email protected]> wrote:

> I created a Shipping Estimate and then I clicked on Remove button to delete
> the shipping estimate, but I got the below error.
>
> It looks it is also trying to delete the record from QuantityBreak table,
> which it shouldn't.
>
>
> The Following Errors Occurred:
>
> Error calling event: org.ofbiz.webapp.event.EventHandlerException: Service
> invocation error (Could not commit transaction for service
> [removeShipmentEstimate] call: Roll back error, could not commit
> transaction, was rolled back instead because of: Failure in
> removeByCondition operation for entity [QuantityBreak]:
> org.ofbiz.entity.GenericDataSourceException: Generic Entity Exception
> occured in deleteByCondition (SQL Exception while executing the
> following:DELETE FROM public.QUANTITY_BREAK WHERE (QUANTITY_BREAK_ID =
> 'RentalStore') (ERROR: update or delete on table "quantity_break" violates
> foreign key constraint "shpmnt_ce_wht_qb" on table
> "shipment_cost_estimate"<br/> Detail: Key (quantity_break_id)=(RentalStore)
> is still referenced from table "shipment_cost_estimate".)). Rolling back
> transaction.org.ofbiz.entity.GenericDataSourceException: Generic Entity
> Exception occured in deleteByCondition (SQL Exception while executing the
> following:DELETE FROM public.QUANTITY_BREAK WHERE (QUANTITY_BREAK_ID =
> 'RentalStore') (ERROR: update or delete on table "quantity_break" violates
> foreign key constraint "shpmnt_ce_wht_qb" on table
> "shipment_cost_estimate"<br/> Detail: Key (quantity_break_id)=(RentalStore)
> is still referenced from table "shipment_cost_estimate".)) (Generic Entity
> Exception occured in deleteByCondition (SQL Exception while executing the
> following:DELETE FROM public.QUANTITY_BREAK WHERE (QUANTITY_BREAK_ID =
> 'RentalStore') (ERROR: update or delete on table "quantity_break" violates
> foreign key constraint "shpmnt_ce_wht_qb" on table
> "shipment_cost_estimate"<br/> Detail: Key (quantity_break_id)=(RentalStore)
> is still referenced from table "shipment_cost_estimate".))))
>
> - Abdullah
>

Reply via email to