Persistent db connection after waking up a computer from sleep?
I'm developing a python app for MAC that interacts with an SQL Server Database after some hardware tests. I have a text box that makes a query into a table on the database and returns if that information has been passed to the test previously or not.
One of the tests that the computer has to pass it's a 10 sleep cycle test. The main problem here is that whenever I want to make a query again with that text box it throws me the following error. Code:
pyodbc.Error ('[08S01]', '[08S01] [Microsoft][ODBC Driver 13 for SQL Server]Communication link failure (0) (SQLEndTran)') Code:
db = pyodbc.connect(driver='{ODBC Driver 13 for SQL Server}', host='servername', database='db', user='user', password='pass') Code:
cur = db.cursor() |
Whenever you get this error, reopen your database-connection.
|
Found solution
Setting pyodbc.pooling = False, did the trick. Supposedly this option keeps persistent connection and I think that when the computer goes to sleep it interrupts the connection and throws the error message. Thank you for your answer!
|
All times are GMT -5. The time now is 03:25 PM. |