-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Made change to alleviate a bug in a multiuser environment with one ... #1126
Made change to alleviate a bug in a multiuser environment with one ... #1126
Conversation
…nteralized database file that near simultaneous database saves may cause changes from one save to be overwritten by changes from the other. This would occur when the second user save happened while the first user save was locking the database file or saving to the tmp file but prior to the copy of the tmp file to the database file. In this case the second user save would not yet see a modified timestamp or size change in the database file and thus start the save process. The save process would wait for the file lock to be removed then overwrite the database causing the changes from the previous save to be lost. This was especially noticible when the database file resided on a network drive with frequent network latency issues.
@@ -1,4 +1,6 @@ | |||
/* Copyright (C) 2003-2015 JabRef contributors. | |||
Copyright (C) 2016 Scott Townsend |
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.
Would you mind removing your name here? All contributors are of course listed in https://github.com/JabRef/jabref/blob/master/AUTHORS.
Thank you very much for your contribution 👍 . |
…ided by the JabRef development team. Moved the check for external changes to the database file into it's own private method and then call that method from both the init() and the run() methods to ensure when a multiple simultaneaous saves are performed the database does not get overwritten.
Sorry to take so long to address the comments and fix the code. I had other projects that needed attention. Thank you for your consideration of my code change. |
Thanks for your revision. |
…centralized database file that near simultaneous database saves may cause changes from one save to be overwritten by changes from the other. This would occur when the second user save happened while the first user save was locking the database file or saving to the tmp file but prior to the copy of the tmp file to the database file. In this case the second user save would not yet see a modified timestamp or size change in the database file and thus start the save process. The save process would wait for the file lock to be removed then overwrite the database causing the changes from the previous save to be lost. This was especially noticeable when the database file resided on a network drive with frequent network latency issues.