Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS Digest, Vol 51, Issue 34

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jonathan Monroe <monroej_freetds AT actualtechnologies.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] FreeTDS Digest, Vol 51, Issue 34
  • Date: Mon, 23 Apr 2007 11:50:19 -0500


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 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 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 first bug.

I have filed a bug report - Dan might want to sign on:

http://www.realsoftware.com/feedback/viewreport.php?reportid=jjotbelo

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 easiest
option if it meets your needs.

I agree, with the added option of waiting for / influencing the RB bug to get fixed.

Jonathan





Archive powered by MHonArc 2.6.24.

Top of Page