On 2008-11-04 18:52, k3xji wrote: > Hi all, > > As development goes on for a server project, it turns out that I am > using the MySQLDB and DB interactions excessively. One questions is > just bothering me, why don't we have a timeout for queries in PEP 249 > (DB API)? > > Is it really safe to wait for a query to finish, means, is it always > returning, even if the DB server goes down? > > And, also from my point view, it may be a good feature. We may use > long/non-critical DB queries with a timeout and slow/critical without > a timeout. This will give us a little chance to prioritize/consume > queries on their criticality? And, I don't see so much effort in > implementing this. One has to change the socket logic in the related > DB's API source code? > > What do you think?
This would be a question for the Python DB-SIG mailing list. Things like timeouts and handling of these is generally something that is very database specific. It is difficult to provide a reliable way of configuring this and may very well not even be within the scope of a database API (e.g. because the timeout has to be configured in the database server using some config file). I'd suggest you check whether MySQL provides a way to set timeouts and you then just use that for your project. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Nov 04 2008) >>> 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,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 -- http://mail.python.org/mailman/listinfo/python-list