Browse Source

Try handling unclosed sql connections by calling dispose on the engine before it is put back into the pool.

ogert 4 years ago
parent
commit
7736e7e830
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cdplib/db_handlers/SQLHandler.py

+ 1 - 1
cdplib/db_handlers/SQLHandler.py

@@ -35,8 +35,8 @@ class SQLHandlerPool(metaclass=SingletonThreadsafe):
         return self._sql_handlers.pop()
 
     def release(self, sql_handler):
+        sql_handler._engine.dispose()
         if len(self._sql_handlers) < self._size:
-            sql_handler._engine.dispose()
             self._sql_handlers.append(sql_handler)
 
 class SQLHandler: