EOFException while executing query in sql

280 Views Asked by At

The code was working fine from the last 1 year properly but from last 1 week I am getting EOFException while Exceuting the select query:The query is as below

SELECT col1,col2,col3,col4 from Table where col1 in ('val1','val2','val3','val4')

The query is working fine when I am trying to exceute the query from SQL but the utility gets stuck when the Utility is trying to execute this query. When I restart the Utility,it starts working fine and then gets stuck again after 2-3 hours and gives EOFException after one hour.

For E.g,I have restarted the utility at 5:00 P.M,So,it works fine till 7:00 P.M and when it started to Execute this query at 7:00 P.M., the utility gets stuck and then gives EOFException at 8:00 P.M. The issue is occuring in Production but unable to find any root cause for this.

Some people using MySQL and Mariadb have recommended to increase the value of net_read_timeout variable but I am unable to increase it because I am using SQLServer 2012 and not able to find any such variable.

1

There are 1 best solutions below

2
SchmitzIT On

Assuming that your utility isn't on the same machine as the SQL Server, try and give this a go. Basically the Remote query timeout setting might be your culprit (which could be the case, considering you mention the one hour cutoff).

For SQL Server, right-click the server, and select properties. Then on the Connections tab, you can check and alter the value of "Remote query timeout" to 0. In my screenshot, the value is set to 600 (10 minutes). If yours shows 3600, you most likely found the reason for the cutoff.

enter image description here