Michael_Coxson_5769

Hidden limit to SearchObject results (5000) -- workaround?

Discussion created by Michael_Coxson_5769 on Mar 27, 2017
Latest reply on Mar 28, 2017 by Michael_Lowry
I am writing some reporting classes and have found that SearchObject queries appear to cap at 5000.  Is this a default value based on SQL settings, is there another way to increase or remove the limit, or do I need to create a work-around and iterate through each given root folder for JOBS objects (hoping any given team will not have more than 5000 objects)?

Example:
SearchObject findJobs = new SearchObject(); findJobs.setTypeJOBS(true); conn.sendRequestAndWait(findJobs);            List<String[]> jobsInfo = new ArrayList<String[]>(); jobsInfo.add(new String[] {"Job","Title","Host","Login","Created","Last Modified"});            Iterator<SearchResultItem> foundJobs = findJobs.resultIterator(); int jobsCount = 0; while (foundJobs.hasNext()) {      OpenObject openJob = new OpenObject(new UC4ObjectName(foundJobs.next().getName()), true, true);      try {           conn.sendRequestAndWait(openJob);           if (openJob.getMessageBox() == null) {                Job job = (Job) openJob.getUC4Object();                jobsInfo.add(new String[] {job.getName(),job.header().getTitle(),job.attributes().getHost().toString(),job.attributes().getLogin().toString(),job.header().getCreated(),job.header().getLastModified()});           }      } catch (TimeoutException | IOException | InvalidUC4NameException e) {           System.out.println("**Error opening object " + foundJobs.next().getName() + " on Level " + conn.getSessionInfo().getSystemName() + " Client " + conn.getSessionInfo().getClient() + "**");      }      jobsCount++; } jobsInfo.add(new String[] {""}); jobsInfo.add(new String[] {"Total Jobs: " + jobsCount});
In this case, any Client queried that has more than 5000 JOBS objects stops reporting content at 5000 and jobsCount returns 5000.  As far as I can tell, this limit is not documented in the Javadoc

Any information for this would be welcome.

Outcomes