[freetds] FreeTDS Digest, Vol 51, Issue 34
monroej_freetds at actualtechnologies.com
Mon Apr 23 12:50:19 EDT 2007
On Apr 23, 2007, at 11:00 AM, James Lowden wrote:
> 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
> 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)
> 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
> correctly, then the question becomes how to put one in effect when
> RealBasic is the "application".
I did a quick test with REALbasic, and it looks like there are some
problems with the ODBC plugin, wrt setting the timeout.
First, the Timeout property is incorrectly requiring a string instead
of an int, so you would have to specify it as follows in your RB code:
Dim db As New ODBCDatabase
db.Timeout = "30" ' should be db.Timeout = 30
Second, according to iODBC trace, the SQLSetConnectOption API
function is not getting called, which may be a side effect of the
I have filed a bug report - Dan might want to sign on:
Unfortunately, I don't think there's a RB workaround, since any
property set using the RB SetConnectionAttribute method:
db.SetConnectionAttribute ODBCConstant.SQL_AUTOCOMMIT, 30
will get set *after* the connection is established.
> 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
> option if it meets your needs.
I agree, with the added option of waiting for / influencing the RB
bug to get fixed.
More information about the FreeTDS