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.
* 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.
Log in to post a comment.