You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is true that ODBC disconnections aren't handled directly by tagreader. However, one client object uses only one connection and one cursor object. When the client object is deleted or otherwise goes out of scope, e.g. by terminating the application, the cursor/connection will also be closed and deleted. I have therefore not seen the need for an explicit disconnect() method so far, except for in PEP 20: "Explicit is better than implicit". But it would probably be quite trivial to add one - if someone could demonstrate it is indeed needed.
import getpass
from requests_ntlm import HttpNtlmAuth
user = "mydomain\" + getpass.getuser()
pwd = getpass.getpass()
auth = HttpNtlmAuth(user, pwd)
c = tagreader.IMSClient(datasource="myplant", url="api.mycompany.com/aspenone", imstype="aspenone", auth=auth, verifySSL=False)
c.connect()
d.disconnect() <----- Add methode for disconnecting not leaving a lot of open connections
The text was updated successfully, but these errors were encountered: