{"record":{"id":"0417cf63605e6feb","repo":"pentaho/pentaho-kettle","slug":"salesforceinput-error-queringmore","errorCode":null,"errorMessage":"SalesforceInput.Error.QueringMore","messagePattern":"SalesforceInput\\.Error\\.QueringMore","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java","lineNumber":680,"sourceCode":"\n  public boolean queryMore() throws KettleException {\n    try {\n      // check the done attribute on the QueryResult and call QueryMore\n      // with the QueryLocator if there are more records to be retrieved\n      if ( !getQueryResult().isDone() ) {\n        this.qr = getBinding().queryMore( getQueryResult().getQueryLocator() );\n        this.sObjects = getQueryResult().getRecords();\n        if ( this.sObjects != null ) {\n          this.recordsCount = this.sObjects.length;\n        }\n        this.queryResultSize = getQueryResult().getSize();\n        return true;\n      } else {\n        // Query is done .. we finished !\n        return false;\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"SalesforceInput.Error.QueringMore\" ), e );\n    }\n  }\n\n  public String[] getAllAvailableObjects( boolean OnlyQueryableObjects ) throws KettleException {\n    DescribeGlobalResult dgr = null;\n    List<String> objects = null;\n    DescribeGlobalSObjectResult[] sobjectResults = null;\n    try {\n      // Get object\n      dgr = getBinding().describeGlobal();\n      // let's get all objects\n      sobjectResults = dgr.getSobjects();\n      int nrObjects = dgr.getSobjects().length;\n\n      objects = new ArrayList<String>();\n\n      for ( int i = 0; i < nrObjects; i++ ) {\n        DescribeGlobalSObjectResult o = dgr.getSobjects()[i];","sourceCodeStart":662,"sourceCodeEnd":698,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java#L662-L698","documentation":"KettleException thrown by SalesforceConnection.queryMore() when fetching the next batch of a paginated QueryResult fails. queryMore() returns true when more records remain; any exception during the locator-based queryMore call is rethrown with 'SalesforceInput.Error.QueringMore'. It means pagination across a large result set broke mid-stream.","triggerScenarios":"Calling queryMore() after the Salesforce session expired (query locator invalid), network interruption between batches, or the query locator timing out (Salesforce locators expire after ~15 minutes of inactivity / session end).","commonSituations":"Long-running transformations processing millions of rows where the session times out mid-pagination, proxy/firewall dropping idle connections between batches, Salesforce API maintenance windows.","solutions":["Check the cause for INVALID_SESSION_ID and reconnect() before re-running the query from the start","Keep the session alive / increase Salesforce session timeout for long batch runs","Restart the transformation with a smaller batch/window if the query locator expired","Verify network stability (disable idle connection drops on proxies)","Reduce rows fetched per call (setRowsInBatch) to shorten each batch window"],"exampleFix":"// before\nwhile (connection.queryMore()) { rowBuffer = connection.getRecords(); }\n// after\ntry { while (connection.queryMore()) { rowBuffer = connection.getRecords(); } }\ncatch (KettleException e) { connection.reconnect(); connection.query(originalSoql); /* resume */ }","handlingStrategy":"retry","validationCode":"if (!connection.testConnection()) { connection.reconnect(); }","typeGuard":"boolean hasActiveSession(Connection c) { try { return c != null && c.getQueryResult() != null; } catch (Exception e) { return false; } }","tryCatchPattern":"try { more = connection.queryMore(); } catch (KettleException e) { if (e.getCause() != null && e.getCause().getMessage().contains(\"INVALID_SESSION\")) { connection.reconnect(); connection.query(soql); } else { throw e; } }","preventionTips":["Increase Salesforce session timeout for long batch jobs","Use setRowsInBatch to keep each queryMore round-trip short","Keep the session active during long paginations (no long idle pauses between batches)","Re-authenticate on INVALID_SESSION_ID and restart pagination from the beginning"],"tags":["salesforce","pagination","session-timeout","api"],"backgroundTag":"request-timeout","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}