[pywin32-bugs] [ pywin32-Bugs-1744647 ] Problem in odbc.pyd
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2007-06-29 16:40:19
|
Bugs item #1744647, was opened at 2007-06-28 03:09 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1744647&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: win32 Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: v_satish (v_satish) Assigned to: Nobody/Anonymous (nobody) Summary: Problem in odbc.pyd Initial Comment: hi, I was trying to use the odbc.pyd provinded in the win32 , but faces with a interesting problem, when ever the sql server goes down or the lan connection between my python program to the SQL server goes down, my python program seems to crash. While troubleshooting the odbc code, i came across the usage of SQLFreeStmt function. This function seems to be removed after odbc V3.0 (http://msdn2.microsoft.com/en-us/library/ms131681.aspx). And this is the same statements that is causing the pyd file to crash too. How can i get around this problem??? regards Satish ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2007-06-29 11:40 Message: Logged In: YES user_id=771074 Originator: NO Rev 1.20 of odbc.cpp should fix this. ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2007-06-28 13:31 Message: Logged In: YES user_id=771074 Originator: NO SQLFreeStmt should probably be replaced, but the main problem is with the reconnect logic. In attemptReconnect, cur->hstmt is freed unconditionally using this function but the value is never reset. A second attempt to reconnect will crash since the handle is already invalidated. One solution would be to set the hstmt to NULL when it's freed, and check for NULL before using it or trying to free it again. As a workaround in Python code, you might be able to just create a new cursor when you get disconnected. However, it might still crash when deallocating the original cursor since the cursor destructor will also call SQLFreeStmt with the invalid handle. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1744647&group_id=78018 |