I am having a strage and randomic issue.Sometimes my application start to throw this kind of error:ActiveRecord::StatementInvalid: TinyTds::Error: Attempt to initiate a new Adaptive Server operation with results pending: EXEC sp_executesql N'SELECT TOP (1) [users].* FROM [users] WHERE [users].[id] = 136'Basically fails on the first query done by the request.This happens on about 30/40 % of the requests while the others runs fine.
After a touch tmp/restart.txt anything is back on normal operation maybe for days or weeks.Is this possibly related to a missing available connections in the pool?
Btw. What should be the correct pool size?
--
You received this message because you are subscribed to the Google Groups "Rails SQLServer Adapter" group.
To post to this group, send email to rails-sqlse...@googlegroups.com.
To unsubscribe from this group, send email to rails-sqlserver-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
Thanks Ken,your answer is very helpful and gave me an idea where to look for.Andrea
On Nov 15, 2012, at 2:12 PM, Ken Collins <k...@metaskills.net> wrote:
Hey Andrea,I am having a strage and randomic issue.Sometimes my application start to throw this kind of error:ActiveRecord::StatementInvalid: TinyTds::Error: Attempt to initiate a new Adaptive Server operation with results pending: EXEC sp_executesql N'SELECT TOP (1) [users].* FROM [users] WHERE [users].[id] = 136'Basically fails on the first query done by the request.This happens on about 30/40 % of the requests while the others runs fine.That error happens when the low level connection, in this case TinyTDS, has been told to execute some SQL and then not told to iterate over the results, hence cleaning the batch. Since the adapter is well tested and will not let such a thing happen, the most common reason left is your own code. So I won't be able to tell you were in your code you can go look, but common patterns would be anywhere you use the #raw_connection (TinyTds::Client) object.After a touch tmp/restart.txt anything is back on normal operation maybe for days or weeks.Is this possibly related to a missing available connections in the pool?No.Btw. What should be the correct pool size?Leave it blank, no value with let ActiveReocrd use the default, which I think is 5. Moot for most people anyway. Only in threaded conditions will the connection pool ever go above 1 anyway.- Ken--
You received this message because you are subscribed to the Google Groups "Rails SQLServer Adapter" group.
To post to this group, send email to rails-sqlserver-adapter@googlegroups.com.
To unsubscribe from this group, send email to rails-sqlserver-adapter+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
I am not sure I get the point of why this is working in this way.Should not make more sense just clean the batch after throwing the exception in any case?
--
You received this message because you are subscribed to a topic in the Google Groups "Rails SQLServer Adapter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rails-sqlserver-adapter/tHfF_gdwctI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to rails-sqlserver-a...@googlegroups.com.
To post to this group, send email to rails-sqlse...@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Rails SQLServer Adapter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rails-sqlserver-adapter/tHfF_gdwctI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to rails-sqlserver-a...@googlegroups.com.
To post to this group, send email to rails-sqlse...@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
I know that looks confused but I am yet 100% sure of what is happening.
--
You received this message because you are subscribed to a topic in the Google Groups "Rails SQLServer Adapter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rails-sqlserver-adapter/tHfF_gdwctI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to rails-sqlserver-a...@googlegroups.com.
To post to this group, send email to rails-sqlse...@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Looks like we are using FreeTDS 0.82.Is this possibly related?
tds version = 7.0 vs a SqlServer 2008
--
You received this message because you are subscribed to a topic in the Google Groups "Rails SQLServer Adapter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rails-sqlserver-adapter/tHfF_gdwctI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to rails-sqlserver-a...@googlegroups.com.
To post to this group, send email to rails-sqlse...@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Rails SQLServer Adapter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rails-sqlserver-adapter/tHfF_gdwctI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to rails-sqlserver-a...@googlegroups.com.
To post to this group, send email to rails-sqlse...@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.