[DB-SIG] Can the cursor.execute method have a timeout specified?

M.-A. Lemburg mal at egenix.com
Fri Aug 6 21:44:35 CEST 2004

Andy Dustman wrote:
> On Fri, 06 Aug 2004 17:24:55 +0000, Anjum Naseer <tpanjum at hotmail.com> wrote:
>>I am running a query which takes a long time and was wondering if there was
>>any way of specifying a timeout?
> There's not a standard (DB-API) way to do it. Your best bet is to see
> if your partiular driver supports a timeout option. This may have to
> be done at the time you create the connection, i.e. in the connect().

If you happen to use ODBC it is likely that you can configure
a timeout by passing in a special parameter to the ODBC driver at
connect time. See the driver documentation for how this is

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Aug 06 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the DB-SIG mailing list