# Read Timed Out Error

**URL:** <https://forum.inductiveautomation.com/t/read-timed-out-error/2714>\
**Category:** Archived Topics\
**Created:** [March 3, 2011, 7:23am UTC](https://forum.inductiveautomation.com/t/read-timed-out-error/2714 "2011-03-03T07:23:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluefrog](https://avatars.discourse-cdn.com/v4/letter/b/a6a055/32.png) [@bluefrog](https://forum.inductiveautomation.com/u/bluefrog)\
**Post date:** [March 3, 2011, 7:23am UTC](https://forum.inductiveautomation.com/t/read-timed-out-error/2714/1 "2011-03-03T07:23:39Z")

</div>

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  
&nbsp;&nbsp;&nbsp;&nbsp;at java.net.SocketInputStream.socketRead0(Native Method)  
&nbsp;&nbsp;&nbsp;&nbsp;at java.net.SocketInputStream.read(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at java.io.BufferedInputStream.fill(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at java.io.BufferedInputStream.read1(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at java.io.BufferedInputStream.read(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at java.net.HttpURLConnection.getResponseCode(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.inductiveautomation.factorypmi.common.gateway\_interface.GatewayInterface.getResponse(GatewayInterface.java:192)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.inductiveautomation.factorypmi.common.gateway\_interface.GatewayInterface.getResponse(GatewayInterface.java:152)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.inductiveautomation.factorypmi.common.gateway\_interface.GatewayInterface.getResponse(GatewayInterface.java:148)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.inductiveautomation.factorypmi.common.gateway\_interface.GatewayInterface.runQuery(GatewayInterface.java:454)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:321)  
&nbsp;&nbsp;&nbsp;&nbsp;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)

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [March 3, 2011, 5:23pm UTC](https://forum.inductiveautomation.com/t/read-timed-out-error/2714/2 "2011-03-03T17:23:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [March 7, 2011, 4:23am UTC](https://forum.inductiveautomation.com/t/read-timed-out-error/2714/3 "2011-03-07T04:23:21Z")

</div>

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