Nov 14, 2011, 2:16:28 AM11/14/11
In the absence of a Reports REST API from Salesforce, I'm attempting
to do a series of SOQL queries that will return the data I need, and
from the returned data assembling the Report I want in Ruby.
It seems to work fine, and against my Sandbox instance I have no
issues at all.
When connecting to a Production instance, I'm running into odd SSL
buffering exceptions, that lead me to believe there might be a
possible bug in the databasedotcom gem or the http adapter.
If I do a standard client.query, then the page size of the returned
collection seems to be 2000 records. If I then do SOQL query using
attributes from all the results in a given collection page to get
related records, then I get the following error:
145:in `sysread_nonblock': Connection reset by peer
`block in request'
databasedotcom/client.rb:289:in `block in http_get'
databasedotcom/client.rb:336:in `block (2 levels) in
databasedotcom/client.rb:335:in `block in
The query is nothing complex, and of the form:
client.query('SELECT Id, Custom_Attribute__c FROM Custom_Object__c
WHERE Id IN ('A','B'...)")
If I modify my code to only do subsequent SOQL queries in batches of
250 records or less, then the code executes fine. Clearly, I could
just operate on batches of 250 records, but this will increase the
number of API calls, and for the Production system I'm aiming to
deploy to this could become an issue.
I suspect the issue might be to do with a chunked response from
Salesforce. Is this the case? What's the solution?
Thanks in advance. M