Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add close sas session function #17

Open
clarkliming opened this issue Jan 10, 2023 · 1 comment
Open

add close sas session function #17

clarkliming opened this issue Jan 10, 2023 · 1 comment

Comments

@clarkliming
Copy link
Collaborator

saspy.SASsession has a method endsas to close the SAS session. by default it is not executed in del method, and this can lead to remote SAS session not closed. in saspy, I think the author want the users to use context like

with saspy.SASsession() as session:
    session.do_something()

since we are storing the SASsessions somewhere, I think we should call the endsas method when R exits. In addition, it is also possible for users to manage these sessions too

@tomweber-sas
Copy link

FYI, endsas() is driven be del(SASsession). It's in all access methods. del is still dependent upon garbage collection actually happening, so just submitting del(sas) doesn't force my code to go through there till gc is driven. But when the Python process ends, I make it go through del before releasing, so that all connection are terminated before Python itself terminates. Hope that answers this for you.
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants