Skip to Content.
Sympa Menu

freetds - [freetds] Query Time Out

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Ou Liu" <OLiu AT corillian.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Query Time Out
  • Date: Mon, 7 Aug 2006 15:21:42 -0700

Sorry, looks like my former post is missing:



Hi,

When using the ODBC driver of FreeTDS, the query will time
out if the query was sent by a statement used before. The code was like:

------------------------------------------------------------------------
------------------------------------------------------------------------
---------------------------

SQLSetStmtAttr (hstmt, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)
40, SQL_IS_UINTEGER);

SQLPrepare(hstmt, "...");

SQLExecute(hstmt);

// fetch the data



// Wait for 3 minutes

SQLFreeStmt(hstmt, SQL_CLOSE);

SQLFreeStmt(hstmt, SQL_UNBIND);

SQLFreeStmt(hstmt, SQL_RESET_PARAMS);

SQLCloseCursor(hstmt);



SQLSetStmtAttr (hstmt, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)
40, SQL_IS_UINTEGER);

SQLPrepare(hstmt, "...");

SQLExecute(hstmt); // here I got a timeout.

------------------------------------------------------------------------
------------------------------------------------------------------------
---------------------------



It looks to me the tds->query_start_time inside the hstmt
was not cleaned up correctly. (Actually the value is the old time for
the first query) This data member looks like a new one to me. (I am
still using the a FreeTDS version from 2004 and only recently updated to
the 0.64 stable)



For now I will just create a new statement handle for each
new query, but I would like to know whether it is a bug or just I am
writing the wrong code.









Archive powered by MHonArc 2.6.24.

Top of Page