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

跟風遠走 提交于 2019-12-12 19:33:22

问题


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

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?


回答1:


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

jdbc:jtds:sqlserver://server:port/database;socketTimeout=120

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.



来源:https://stackoverflow.com/questions/38225414/how-can-i-solve-socket-closed-when-report-takes-long-time-to-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!