-
Notifications
You must be signed in to change notification settings - Fork 189
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
Result from a dead connection is false. Should it throw an exception? #464
Comments
I've seen this before as well, and I don't like it... I agree TinyTDS should do a better job with this in my opinion. |
I tried to write a test this evening to reproduce this error (basically that What works consistently on my machine (and about 90% of the time on CI) is the following: it 'raises error when query cannot be sent' do
client = new_connection
assert_client_works(client)
thread1 = Thread.new do
client.execute("SELECT 1 as [one]").do
end
thread2 = Thread.new do
assert_equal false, client.execute("SELECT 1 as [one]")
end
thread1.join
thread2.join
end I assume, when the result are read in I would suggest: We implement the exception as suggest in #469, but without any tests, as long as we do not know how to reliably trigger it. Still, I think the exception would be an improvement, since it prevents subsequents errors for users. |
Before submitting an issue please check these first!
$ tsql -C
to find out.If none of these help. Please fill out the following:
Environment
Operating System
TinyTDS Version and Information
Description
Previously posted this on the sequel gem. It looks like there's an expectation for the TinyTDS client to raise an exception when the connection is dead, not return false.
The following shows that the client is returning false:
The text was updated successfully, but these errors were encountered: