Read Timed Out Error

Hi all,

I got this problem when I try to run a query from a table in PMI and I haven’t got any result. But the query is too complex and it takes nearly two minutes when I run it in SQL Server Management Studio. I tried to set the connection time using fpmi.system.setConnectTimeout() function. But I still have that problem. Please let me know how to solve it. I also pasted the error message.

Message: Connection lost because of following error:Read timed out
Time: Thu Mar 3 2:56:45PM
Severity: ERROR
Logger: factorypmi.common.gateway_interface.ConnectionStatus
Stack Trace: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:192)
    at com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:152)
    at com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:148)
    at com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.runQuery(GatewayInterface.java:454)
    at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:321)
    at java.lang.Thread.run(Unknown Source)

Stack Trace: java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(Unknown Source)
java.io.BufferedInputStream.fill(Unknown Source)
java.io.BufferedInputStream.read1(Unknown Source)
java.io.BufferedInputStream.read(Unknown Source)
sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
java.net.HttpURLConnection.getResponseCode(Unknown Source)
com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:192)
com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:152)
com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:148)
com.inductiveautomation.factorypmi.common.gateway_interface.GatewayInterface.runQuery(GatewayInterface.java:454)
com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:321)
java.lang.Thread.run(Unknown Source)

There is not a way to edit the read timeout setting in FactoryPMI. You will have to optimize the query in order to get it working.

If you need help, post the query here and some of the SQL guru’s will take it apart for you.