[pywin32-bugs] [ pywin32-Patches-1706430 ] Access violation in odbc when DB is down
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: SourceForge.net <no...@so...> - 2008-04-10 04:24:44
|
Patches item #1706430, was opened at 2007-04-24 20:01 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=1706430&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Out of Date Priority: 5 Private: No Submitted By: Michael Foetsch (foetsch) Assigned to: Nobody/Anonymous (nobody) Summary: Access violation in odbc when DB is down Initial Comment: When a DB connection is opened using "odbc.odbc()", and the connection object is reused for several queries (which it usually is), an access violation might occur. To reproduce: * Open a connection * Execute an SQL query * Shut down the SQL database service * Execute another SQL query using the same connection object * A Python exception occurs, which is expected * When the DB cursor is garbage collected (or when you invoke "close()" on it explicitly), Python crashes with an access violation within the ODBC DLL (I tried using Win XP and SQL Server 2005) In the patch, the access violation is caught using a __try/__except. This also allows "attemptReconnect()" to do its magic when the SQL service goes back up. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2008-04-10 14:24 Message: Logged In: YES user_id=14198 Originator: NO Thanks - but a slightly different version of a similar patch was checked in r1.20 of odbc.cpp ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=1706430&group_id=78018 |