-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
Python: 3.12.1
Driver details:
unixODBC 2.3.11
odbcinst.ini
[ODBC]
Pooling=YES
[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.5.so.1.1
UsageCount=1
:
Minimal Code Example:
@contextlib.contextmanager
def connection(self) -> pyodbc.Connection:
cxn = pyodbc.connect(...)
try:
yield cxn
finally:
cxn.close()
def main():
while True:
with connection() as cxn:
pass
time.sleep(.1)
main()
The above code will eventually consume 100% of the system's memory (if left to run long enough).
Metadata
Metadata
Assignees
Labels
No labels