How can I solve socket closed when report takes long-time to run?

I am running reports in Clarity made with iReport.

One of my reports is quite complex and sometimes takes a long time to run (depending on parameters). Sometimes, it takes too long and I get a message that says

  • How do I generate random number for each row in a TSQL Select?
  • SQL Server How to output one table result from multiple results with a WHILE query
  • SQL SERVER Combining two columns as one column if a conditions happens
  • How do I create MS SQL tables for a fresh WordPress installation?
  • Compatible SQL to test for not null and not empty strings
  • Socket Closed

    This message does not appear when the report runs quickly. I would assume that this means that the run has timed-out. I am currently working to make the SQL run faster, but I fear it will still not be before the time-out.

    Is there anyway to make the socket stay open longer?

    screenshot of error message

    One Solution collect form web for “How can I solve socket closed when report takes long-time to run?”

    You can put additional parameters into the connection string, e.g.


    This should only be used as a last resort, though. Maybe bad infrastructure or a too complex query with not enough indices is the real reason for a slow running query.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.