import pyodbc
import time
connection = pyodbc.connect(..............)
cursor = connection.cursor()
while True:
time.sleep(1)
cursor.execute(INSERT_QUERY)
cursor.commit()
that works. but suddenly I got an exception pyodbc.Error: ('08S01', '[08S01] [Microsoft][ODBC SQL Server Driver]Communication link failure (0) (SQLExecDirectW)')
Why is that ?Why the link suddenly disconnect ? How can I handle that exeption and re-connect? how can I fix that?