-
Notifications
You must be signed in to change notification settings - Fork 130
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 a blocking commit after each modification if autocommit is enabled. #94
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make sense to me.
Could you please add some tests? Ideally, the tests should fail without your modified code, illustrating a problem with the implementation. Obviously, the tests should pass once your modified code is in place.
Sorry for the delay, but I finally have a working test for this. Because this bug only shows up near program exit, I had to create a test that launches python in a subprocess, and because of path issues, I had to add a symlink for sqlitedict.py into the tests directory (or else my tests were picking up the system version of the library). |
Is there anything more I need to do before this can be merged? |
Sorry, I've been a bit busy lately. No, there's nothing else you need to do, please leave it with me. |
I'm eager to get this merged into the main release. I'd like to use this library at work, but they would prefer running a vanilla version of the software, and my use case will not work without this patch. |
@endlisnis thanks for your patience. @mpenkov will be back to open source after the New Year! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'm finally back and had a chance to look at your tests. It's a step in the right direction, but could be better. Please have a look at the questions and comments I left.
Co-Authored-By: Michael Penkov <[email protected]>
…t2.py file (reduce file count).
Co-Authored-By: Michael Penkov <[email protected]>
Co-Authored-By: Michael Penkov <[email protected]>
I have completed all the requested changes. Please let me know if there is anything more you'd like me to do. |
OK, merged. Thank you for your hard work and your patience!! |
This change modifies how "autocommit" works. It forces each modification to block until the commit is complete. Without this, if the program exited after modifying the sqlitedict, the changes might not make it to disk. With this change, all changes are guaranteed to be on disk before the modification action returns.
Fixes #93 .