> OK.Tried it. Just my luck. The database driver does not support this
> option.
John, could you please post the exception you get?
SQL_ATTR_CONNECTION_TIMEOUT can be set at connection or at statement
level.
I usually access the Teradata RDBMS, and Teradata's ODBC driver does
not support SQL_ATTR_CONNECTION_TIMEOUT in SQLSetConnectAttr()
[connection level]. Instead, it returns "HYC00 - Optional feature not
implemented". According to
http://msdn.microsoft.com/en-us/library/ms713605(VS.85).aspx
this means that "The value specified for the argument Attribute was a
valid ODBC connection or statement attribute for the version of ODBC
supported by the driver but was not supported by the driver."
*but* in the Teradata case SQLSetStmtAttr() - which may get called in
Cursor_New() [cursor.cpp] - supports SQL_ATTR_QUERY_TIMEOUT [statement
level]. Today, cnxn->timeout keeps its default value of 0 because of
the HYC00 described above and SQLSetStmtAttr() is not called.
I really wonder whether your RDBMS displays the same behaviour.
It might make sense to modify Connection_settimeout() in
connection.cpp to set cnxn->timeout even in the case of an HYC00. This
would trigger Cursor_New() in cursor.cpp to set the query timeout at
statement level.
Regards,
Alexander