4 Replies Latest reply on Aug 25, 2015 8:19 AM by LJ LongWing

    Is there any limit of maxRetrieve parameter for getListEntryObjects method?

    Stefano Omini
      Share This:

      Hi,

       

      I have an issue with Java APIs for Remedy 8.1

       

      To extract

       

      I have a Java extractor which queries the content of a form and splits the extraction of elements into multiple chunks.

      This is implemented by using getListEntryObjects method, defining the maxRetrieve size, and looping until new items are found.

       

      {code}

      int objfrom=0;

      int size=0;

      List<Entry> entryList=new ArrayList<Entry>();

      do{ 

        // Retrieve entries from the form using the given qualification

        entryList = context.getListEntryObjects(

        formName,  // formName - String name of the form that containing the entries

        qual, // qualification - QualifierInfo query that determines the set of entries to retrieve

        objfrom, // firstRetrieve - first entry to retrieve. A value of 0 represent the first entry.

        FindObjLimit, // maxRetrieve - maximum number of entries to retrieve

        sortOrder, // sortList - list of SortInfo instances that define the sort order for list of entries returned

        fieldIds, // fieldIds - array of int field IDs that specify the fields in the result.

        true, // useLocale - boolean flag that controls whether the result includes only entries based on locale (1 or TRUE) or all entities (0 or FALSE).

        nMatches // nMatches - returns the number of (accessible) entries that match the qualification criteria.

        );

       

        [...]

        size=entryList.size();

       

        objfrom+=size;

       

       

      } while (size==FindObjLimit);

      {code}

       

      The code I'm using is pretty simple and it's working correctly for "low" values of maxRetrieve parameter.

       

      Since I wanted to evaluate performances, I started to change the parameter value in order to find the best tradeoff.

      For example, supposing we have to extract 10.000 items, I wanted to see if 10 extractions of 1000 elements each were faster/slower than 5 extractions of 2000 elements each.

       

      While doing this, I realized than setting a maxRetrieve value = 6000 was resulting in the extraction of maximum 4000 items.

       

      test1, with chunk size parameter = 3000

      form 1 --> 58711 items extracted

      form 2 --> 3205 items extracted

      form 3 --> 185114 items extracted

       

      test1, with chunk size parameter = 6000

      form 1 --> 3995 items extracted

      form 2 --> 3205 items extracted

      form 3 --> 4000 items extracted


      it seems that for high values of maxRetrieve, the API is returning only 4000 items, and no more than it (i.e. the iteration stops).


      Can you explain why this is happening?

      Is there any hardcoded maximum value of maxRetrieve which cannot be exceeded?


      Thanks


      Stefano