Commits

Mike Bayer committed 69876ad Merge

Merge pull request #51 from sontek/pymssql_handle_terminated_connection

Remove terminated connections from the pool.

  • Participants
  • Parent commits 282a19d, 3147ca3

Comments (0)

Files changed (2)

File lib/sqlalchemy/dialects/mssql/pymssql.py

     def is_disconnect(self, e, connection, cursor):
         for msg in (
             "Adaptive Server connection timed out",
+            "Net-Lib error during Connection reset by peer",
             "message 20003",  # connection timeout
             "Error 10054",
             "Not connected to any MS SQL server",

File test/dialect/mssql/test_engine.py

 
         for error in [
                 'Adaptive Server connection timed out',
+                'Net-Lib error during Connection reset by peer',
                 'message 20003',
-                "Error 10054",
-                "Not connected to any MS SQL server",
-                "Connection is closed"
+                'Error 10054',
+                'Not connected to any MS SQL server',
+                'Connection is closed'
                 ]:
             eq_(dialect.is_disconnect(error, None, None), True)