Incidentally, metaskills updated TinyTDS to 0.4.3 today and added the .active? method which is basically c.closed? || c.dead?.
Is the backwards compatibility really necessary? Sequel didn't even work with TinyTDS until the 0.4 release. Thanks for patching this though. I have 0.4.3 running along with this release of Sequel on my test server and I'll keep checking it for the next few days. On Mar 31, 7:51 pm, Jeremy Evans <[email protected]> wrote: > 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.
