-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLSRV_ATTR_QUERY_TIMEOUT issue #1059
Comments
hi @cosmic-horizon , note that we no longer support SQL Server 2008 That being said, we have merged a pull request to fix query timeout issues (#1037) , which we will roll out in our upcoming preview release. In the meantime, please modify your script to utilize the exception mechanism for query timeouts. When it's timed out, an exception will be thrown from within the driver, so try not to comment out the following line.
See if this makes a difference. |
hi @yitam ,thanks for answer, but it seems doesn't work |
@cosmic-horizon but that's another issue. The message indicated a connection error. What's your unixODBC version? Can you also check your sql server settings, like if you have set maximum number of remote connections and remote login timeout, etc. Please also try with another instance of SQL Server that we officially support |
|
Are you using connection pooling, @cosmic-horizon ? A race condition exists such that the connection is valid initially but later becomes invalid when sending the query. The fix to detect dead connections in the pool was merged into unixODBC 2.3.7. Make sure you don't have multiple unixODBCs in your env. Also, connection resiliency in the latest drivers might be able to help, like this:
|
I'm not use connection pooling,
and connection resiliency seems support only sql 2014 and higher |
Perhaps you can enable odbc tracing. After modifying your odbcinst.ini file please also modify your connection string to enable "TraceOn":
Then send us your odbc trace log. |
here to trace logs: //this take 400ms work without an error
//this take 20 seconds and response is tcp provider error
|
@cosmic-horizon please provide the entire trace log or at least up to the point when it starts failing. |
@yitam I got tcp error sometimes but didn't find any error records in the 1,500,000 line log records.Maybe that error is caused by sql server settings |
@cosmic-horizon is the tcp error the same message all the time? How often do you get the error(s)? RE your screenshot above, it helps if you show the entire error message, like a var_dump, for example:
|
Any update @cosmic-horizon ? |
+## PHP Driver version or file name
+Lastest version
+## SQL Server version
+## Client operating system
+## PHP version
+## Microsoft ODBC Driver version
+Lastest version
I connect to remote a mssql databas . But sometimes mssql connect take long time or gives errors.
I want to set a query time out or mssql connect login time out.
I thinks connect timeout works well,query time out doesn't work as I wanted.
Sometimes gives time out as i wanted but sometimes waiting 19-40 second and gives tcp error
İ don't want to wait too long for response.
my request to mssql db;
My Connect Configuration
The text was updated successfully, but these errors were encountered: