Delegator.findList calls Delegator.find, so I think the problem lies somewhere else.

If you look carefully at your patch, you might spot where it is.

-Adrian

On 5/9/2013 10:42 AM, Hans Bakker wrote:
Currently there is a problem in the findshipping screen at: https://localhost:8443/facility/control/FindShipment, the list is empty although there are shipments.

When i replace the delegator.find with a delegator.findList it works again. The code gets smaller however i can imagine the delegator.find is used in other places?

could it be caused by the recent refactoring?

the diff to replace find with findList:
Index: applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy
===================================================================
--- applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (revision 1480573) +++ applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (working copy)
@@ -132,25 +132,15 @@
         lowIndex = viewIndex * viewSize + 1;
         highIndex = (viewIndex + 1) * viewSize;
         findOpts.setMaxRows(highIndex);
-
+        findOpts.setOffset(lowIndex);
+
         if (!orderReturnValue) {
-            // using list iterator
- orli = delegator.find("Shipment", mainCond, null, null, orderBy, findOpts);
-
-            shipmentListSize = orli.getResultsSizeAfterPartialList();
+ shipmentList = delegator.findList("Shipment", mainCond, null, orderBy, findOpts, false);
+            shipmentListSize = shipmentList.size();
             if (highIndex > shipmentListSize) {
                 highIndex = shipmentListSize;
             }
-
-            // get the partial list for this page
-            if (shipmentListSize > 0) {
-                shipmentList = orli.getPartialList(lowIndex, viewSize);
-            } else {
-                shipmentList = [] as ArrayList;
-            }
-
-            // close the list iterator
-            orli.close();
+
         }

         if (orderReturnValue) {
@@ -202,7 +192,7 @@
// only commit the transaction if we started one... this will throw an exception if it fails
         TransactionUtil.commit(beganTransaction);
     }
-
+
     context.shipmentList = shipmentList;
     context.listSize = shipmentListSize;
     context.highIndex = highIndex;

Reply via email to