Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS and Ubuntu, iodbc

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>, <mohnd AT egolfscore.com>
  • Subject: Re: [freetds] FreeTDS and Ubuntu, iodbc
  • Date: Mon, 23 Apr 2007 17:07:33 +0200

> Dan Mohn wrote:
> >
> > For the 2nd test, I set the freetds.conf timeouts to 100, so they
> > wouldn't timeout at the WAITFOR, then after 20 seconds,
> (even though it
> > wasn't timing out anyway, but just to be safe) I pull the
> cable. I did
> > this about an hour ago, but no response back.
>
> Hi Dan,
>
> Frediano just told me our ODBC driver doesn't honor the timeout in
> freetds.conf. I didn't know that!
>
> According to the ODBC standard, it's up to the application to set a
> timeout via SQLSetStmtAttr(SQL_ATTR_QUERY_TIMEOUT). AFAIK
> the driver is
> allowed to have any default timeout it chooses. FreeTDS's
> default timeout
> is infinite; Microsoft's (AIUI) is shorter.
>
> What we can do is first add a timeout option to bsqlodbc, so
> we can see if
> the timeout is working correctly or not. And we can
> (eventually) change
> the driver to respect the timeout in freetds.conf.
>
> Your original query had to do with RealBasic. On the
> evidence, it's not
> setting a timeout. If we can demonstrate the ODBC driver
> handles timeouts
> correctly, then the question becomes how to put one in effect when
> RealBasic is the "application". I think you have these choices:
>
> 1. Wait for one of us to change the driver.
> 2. Change the driver yourself.
> 3. Find the default timeout value (zero) in the ODBC driver,
> set it to
> something you like, and rebuild. I think this is the
> simplest and easiest
> option if it meets your needs.
>

With this patch (attached) I got


$ time ./bsqlodbc -v -S$S -U$U -P$P -i timeout.sql
lt-bsqlodbc:265: Verbose operation enabled
lt-bsqlodbc:354: Query:
print 'hello'
select 1 as one
WAITFOR DELAY '00:00:30'
print 'goodbye'
select 2 as two

lt-bsqlodbc: error -1: SQLExecute: SQL_ERROR: failed
"[FreeTDS][SQL Server]hello"
"[FreeTDS][SQL Server]Timeout expired"

real 0m10.165s
user 0m0.053s
sys 0m0.082s


which is ok !

freddy77

Attachment: vedi.diff
Description: vedi.diff




Archive powered by MHonArc 2.6.24.

Top of Page