Thanx. This is to a MSSQL server which doesn't seem to have the ability to set the timeout using SQL :/
I ended up "cloning" the current connection and creating a new one with a larger timeout, and then discarding it afterwards: Sequel.connect(original_db.uri, timeout: 360) do |db| db[long_running_query] end J On Tuesday, 1 May 2018 23:58:52 UTC+2, Jeremy Evans wrote: > > On Tuesday, May 1, 2018 at 1:49:57 PM UTC-7, Jurgens du Toit wrote: >> >> I'm working on a system where our connection timeout is relatively >> standard, and works properly most of the time. >> >> There area a couple of queries though that will run longer than the >> timeout allows. Is it possible to set the timeout just for that specific >> query, instead of all queries on a connection? >> > > Possibly, but it is going to be database specific code. I would use a > block based approach, add a method that sets the new query timeout for the > connection, yield to the block, ensure block to set the query timeout back > to the previous value. This assumes the timeout can be adjusted by issuing > SQL. > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to sequel-talk+unsubscr...@googlegroups.com. To post to this group, send email to sequel-talk@googlegroups.com. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.