--- a/server/sources/native.py Fri May 28 08:05:17 2010 +0200
+++ b/server/sources/native.py Sat May 29 10:18:02 2010 +0200
@@ -444,6 +444,15 @@
self.warning("trying to reconnect")
session.pool.reconnect(self)
cursor = self.doexec(session, sql, args)
+ except (self.DbapiError,), exc:
+ # We get this one with pyodbc and SQL Server when connection was reset
+ if exc.args[0] == '08S01':
+ self.warning("trying to reconnect")
+ session.pool.reconnect(self)
+ cursor = self.doexec(session, sql, args)
+ else:
+ raise
+
results = self.process_result(cursor, cbs)
assert dbg_results(results)
return results