You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2011/02/10 19:51:20 UTC

svn commit: r1069528 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java

Author: mrisaliti
Date: Thu Feb 10 18:51:19 2011
New Revision: 1069528

URL: http://svn.apache.org/viewvc?rev=1069528&view=rev
Log:
Change the return code from getPreviousNextProducts method of CategoryServices to failure so it cannot causes the transaction to be marked for rollback as suggested by Martin Kreidenweis on the dev mailing list.

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java?rev=1069528&r1=1069527&r2=1069528&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java Thu Feb 10 18:51:19 2011
@@ -87,8 +87,7 @@ public class CategoryServices {
         Locale locale = (Locale) context.get("locale");
         
         if (index == null && productId == null) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
-                    "categoryservices.problems_getting_next_products", locale));
+            return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceError, "categoryservices.problems_getting_next_products", locale));
         }
 
         List<String> orderByFields = UtilGenerics.checkList(context.get("orderByFields"));
@@ -102,9 +101,7 @@ public class CategoryServices {
             productCategoryMembers = delegator.findByAndCache(entityName, UtilMisc.toMap("productCategoryId", categoryId), orderByFields);
         } catch (GenericEntityException e) {
             Debug.logInfo(e, "Error finding previous/next product info: " + e.toString(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
-                    "categoryservices.error_find_next_products", 
-                    UtilMisc.toMap("errMessage", e.getMessage()), locale));
+            return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceError, "categoryservices.error_find_next_products", UtilMisc.toMap("errMessage", e.getMessage()), locale));
         }
         if (activeOnly) {
             productCategoryMembers = EntityUtil.filterByDate(productCategoryMembers, true);
@@ -132,8 +129,7 @@ public class CategoryServices {
 
         if (index == null) {
             // this is not going to be an error condition because we don't want it to be so critical, ie rolling back the transaction and such
-            return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
-                    "categoryservices.product_not_found", locale));
+            return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceError, "categoryservices.product_not_found", locale));
         }
 
         Map<String, Object> result = ServiceUtil.returnSuccess();