[R-sig-DB] RODBC: Set connection and command timeout values => how to request features? Source code repository available to contribute patches? [retry]

@osp@m m@iii@g oii @itieid-im@de @osp@m m@iii@g oii @itieid-im@de
Wed Nov 30 23:06:15 CET 2016


Hi,

I have some improvement suggestions and ideas,
but I cannot find a public master repository on github, sourceforge or
elsewhere that contains the current development branch of RODBC.

How could I
- file a feature request
- contribute code?

Thank you very much + best regards



PS: My feature requests are:
----------------------------

1. Add a possibility to set the connection timeout in seconds
2. Add a possibility to set the statement (sql command) timeout in
seconds

I think many users of RODBC have already struggled with the too
short default timeout values of e. g. 30 seconds which are
problematic in case of long running queries e. g. in the
data warehousing or reporting context.


Implementation:
---------------

The implementation should be quite straightforward (similar to
"SEXP RODBCSetAutoCommit(SEXP chan, SEXP autoCommit)" function
in the file "RODBC.c".

To change the timeout values the ODBC API offers two functions:

1. SQLSetConnectAttr()

https://msdn.microsoft.com/en-us/library/ms713605(v=vs.85).aspx

Attribute to set SQL_ATTR_CONNECTION_TIMEOUT

An SQLUINTEGER value corresponding to the number of seconds to wait for
any request on the connection to complete before returning to the
application. The driver should return SQLSTATE HYT00 (Timeout expired)
anytime that it is possible to time out in a situation not associated
with query execution or login.

2. SQLSetStmtAttr()

https://msdn.microsoft.com/en-us/library/ms712631(v=vs.85).aspx

Attribute to set: SQL_ATTR_QUERY_TIMEOUT (ODBC 1.0)

An SQLULEN value corresponding to the number of seconds to wait for an
SQL statement to execute before returning to the application. If
ValuePtr is equal to 0 (default), there is no timeout.
If the specified timeout exceeds the maximum timeout in the data source
or is smaller than the minimum timeout, SQLSetStmtAttr substitutes that
value and returns SQLSTATE 01S02 (Option value changed).
Note that the application need not call SQLCloseCursor to reuse the
statement if a SELECT statement timed out.
The query timeout set in this statement attribute is valid in both
synchronous and asynchronous modes.




More information about the R-sig-DB mailing list