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
neomodel closes sessions only after object is deleted #259
Comments
Thanks for raising this issue. Coupled to it is also the issue with the connection clean up causing some strange exceptions in neo4j_drivers destructor. Spent a while trying to figure it out to no avail but will let you know as soon as I find a solution |
@robinedwards Thanks a lot. let me know if there's any help needed |
@aanastasiou - That indeed would be more declarative rather than let python's gc do it |
@liranbg Thanks for such a quick response. Just to understand the severity of the problem, what is the worst that can happen from leaving this up to the system? Besides the exceptions on exit (which I have experienced myself as well) do you think this could be causing any transaction related problems too? (for example). |
sorry for this late response. since I did not test it, I am not certain about it. |
@liranbg Right, sounds good, I have marked it as an enhancement and hope to see it taken care of relatively soon. All the best |
I have noticed that after repeatedly running
|
Using neomodel 3.2.5
I figured when using transaction with db.begin() and db.commit() it does not close the session immediately but when the object itself is being destroyed.
I used the following test to determine when the session is being close by using logging's output to check when the object is being deleted (before the tearDown() or after)
in test_session_closing_neomodel -> it closes session only after deleted
in test_session_closing_neodriver -> it closes session when transaction is ended
The text was updated successfully, but these errors were encountered: