svn commit: r544599 - in /ofbiz/branches/release4.0/applications/product: servicedef/services_shipment.xml src/org/ofbiz/shipment/shipment/ShipmentServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r544599 - in /ofbiz/branches/release4.0/applications/product: servicedef/services_shipment.xml src/org/ofbiz/shipment/shipment/ShipmentServices.java

sichen
Author: sichen
Date: Tue Jun  5 12:11:17 2007
New Revision: 544599

URL: http://svn.apache.org/viewvc?view=rev&rev=544599
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/branches/release4.0/applications/product/servicedef/services_shipment.xml
    ofbiz/branches/release4.0/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java

Modified: ofbiz/branches/release4.0/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/product/servicedef/services_shipment.xml?view=diff&rev=544599&r1=544598&r2=544599
==============================================================================
--- ofbiz/branches/release4.0/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/branches/release4.0/applications/product/servicedef/services_shipment.xml Tue Jun  5 12:11:17 2007
@@ -624,7 +624,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>
@@ -648,7 +648,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/branches/release4.0/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?view=diff&rev=544599&r1=544598&r2=544599
==============================================================================
--- ofbiz/branches/release4.0/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java (original)
+++ ofbiz/branches/release4.0/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Tue Jun  5 12:11:17 2007
@@ -241,8 +241,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");
         }
 
         // Get the possible estimates.
@@ -340,7 +339,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