Author: sichen
Date: Tue Jun 5 12:10:13 2007 New Revision: 544598 URL: http://svn.apache.org/viewvc?view=rev&rev=544598 Log: Turn off unnecessary transactions for some shipping estimate services, and return failure instead of error when calcShipmentCostEstimate was not able to find an estimate, because that could cause global rollbacks at inappropriate times Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=544598&r1=544597&r2=544598 ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Tue Jun 5 12:10:13 2007 @@ -628,7 +628,7 @@ </service> <service name="calcShipmentCostEstimate" engine="java" - location="org.ofbiz.shipment.shipment.ShipmentServices" invoke="calcShipmentCostEstimate" auth="false"> + location="org.ofbiz.shipment.shipment.ShipmentServices" invoke="calcShipmentCostEstimate" auth="false" use-transaction="false"> <description>Generic Shipment Cost Estimate Calc Service - Use ShipmentCostEstimate Entities</description> <implements service="calcShipmentEstimateInterface"/> </service> @@ -652,7 +652,7 @@ </service> <service name="getShipmentPackageValueFromOrders" engine="java" - location="org.ofbiz.shipment.shipment.ShipmentServices" invoke="getShipmentPackageValueFromOrders" auth="true"> + location="org.ofbiz.shipment.shipment.ShipmentServices" invoke="getShipmentPackageValueFromOrders" auth="true" use-transaction="false"> <description>Calculates the total value of a shipment package by totalling the results of the getOrderItemValue service for the orderItem related to each ShipmentPackageContent, prorated by the quantity of the orderItem packed in the ShipmentPackageContent. Value is converted according to the incoming currencyUomId.</description> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?view=diff&rev=544598&r1=544597&r2=544598 ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Tue Jun 5 12:10:13 2007 @@ -245,8 +245,7 @@ try { shipAddress = delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", shippingContactMechId)); } catch (GenericEntityException e) { - Debug.logError(e, module); - return ServiceUtil.returnError("Cannot get shipping address entity"); + return ServiceUtil.returnFailure("Cannot get shipping address entity"); } if (shippingContactMechId != null) { @@ -358,7 +357,7 @@ } if (estimateList.size() < 1) { - return ServiceUtil.returnError("No shipping estimate found for carrier [" + carrierPartyId + "] and shipment method type [" + shipmentMethodTypeId +"]"); + return ServiceUtil.returnFailure("No shipping estimate found for carrier [" + carrierPartyId + "] and shipment method type [" + shipmentMethodTypeId +"]"); } // make the shippable item size/feature objects |
Free forum by Nabble | Edit this page |