On Mar 31, 9:42 am, cult hero <[email protected]> wrote:
> Huh. I think I discarded my reply so hopefully this doesn't turn into
> a double post. Incidentally, binarypaladin is me.
>
> After going back and forth on this metaskills put in a patch that
> appears to have fixed everything at my end and his end. The only minor
> downside is that my patch to Sequel is incomplete. It should look like
> this:
>
> --- a/lib/sequel/adapters/tinytds.rb
> +++ b/lib/sequel/adapters/tinytds.rb
> @@ -38,7 +38,7 @@ module Sequel
>              end
>              yield(r) if block_given?
>            rescue TinyTds::Error => e
> -            raise_error(e)
> +            raise_error(e, :disconnect=>(c.closed? || c.dead?))
>            ensure
>             r.cancel if r && c.sqlsent?
>            end
>
> The next version of TinyTDS will support the .dead? method like the
> patched version I'm running.

OK.  For backwards compatibility, I'll probably do this:

diff --git a/lib/sequel/adapters/tinytds.rb b/lib/sequel/adapters/
tinytds.rb
index 06ba225..18ee86b 100644
--- a/lib/sequel/adapters/tinytds.rb
+++ b/lib/sequel/adapters/tinytds.rb
@@ -39,7 +39,7 @@ module Sequel
             end
             yield(r) if block_given?
           rescue TinyTds::Error => e
-            raise_error(e, :disconnect=>c.closed?)
+            raise_error(e, :disconnect=>(c.closed? || (c.respond_to?
(:dead?) && c.dead?)))
           ensure
            r.cancel if r && c.sqlsent?
           end

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to