Skip to content
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

Timeout property seems to do nothing #6

Open
nhgrif opened this issue Feb 21, 2014 · 6 comments
Open

Timeout property seems to do nothing #6

nhgrif opened this issue Feb 21, 2014 · 6 comments
Assignees

Comments

@nhgrif
Copy link
Contributor

nhgrif commented Feb 21, 2014

I've set a timeout value of 3 (this is 3 seconds, right?).

I've executed a query to select 30,000 rows from a table with several columns (in practice, I don't need a result this big, but I'm forcing the issue here). Timing the query results in a time of over 4 seconds. This doesn't count the time to display or do anything with the date. The first time is marked just before execute is called and the second time is marked as the first line in the completion block of the execute method. The query should have timed out before this.

@nhgrif
Copy link
Contributor Author

nhgrif commented Feb 21, 2014

Again, this is happening on SQL Server 2008 R2 and SQL Sever 2005

@nhgrif
Copy link
Contributor Author

nhgrif commented Feb 21, 2014

In SQLClient.m, dbsetlogintime(self.timeout); is called. However, this seems to only apply to login times (I've not been able to successfully test whether or not this one is actually working or not). However, FreeTDS also has a function called dbsettime() which is supposed to set timeouts for queries. I'm trying to get this to work, but no luck so far.

@martinrybak martinrybak self-assigned this Feb 24, 2014
@martinrybak
Copy link
Owner

Yes, I can't get dbsettime() to work either. Going to have to do a workaround.

@nhgrif
Copy link
Contributor Author

nhgrif commented Mar 10, 2014

Martin, I suspected that the reason the query wasn't timing out with the above example was because the dbsettime() only cares about the time between beginning the query and getting the first response. It seems my suspicion was accurate. When I lock up a table using BEGIN TRANSACTION, then through your SQLClient, try to execute a query on the locked table, I am able to get error # 20003, Adaptive Server connection timed out with severity 6. This is only after adding a called to dbsettime() though (I was using 1 second for testing purposes).

It might be nice to have a workaround for timing out query after the initial response, but for now at least, dbsettime() should be included.

@nhgrif
Copy link
Contributor Author

nhgrif commented Mar 10, 2014

I've created pull requests. You may see a better way to implement this. I'll close this issue when everything is updated. Renaming the "timeout" property to "loginTimeout" might be something to consider as well.

@martinrybak
Copy link
Owner

Thanks so much for your help! I appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants