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

can multiple processes write to same db? #479

Closed
ralyodio opened this issue Dec 8, 2016 · 4 comments
Closed

can multiple processes write to same db? #479

ralyodio opened this issue Dec 8, 2016 · 4 comments

Comments

@ralyodio
Copy link

ralyodio commented Dec 8, 2016

I've found issues when multiple process update flat json files...sometimes the file will get corrupt.

I'm curious if nedb has solved this or if I should be careful not to update the database asynchronously or from multiple processes.

@louischatriot
Copy link
Owner

Hello, the answer is no, you should never access the same nedb instance from multiple processes. Typically it would not work, as the first process will get a lock on writing to the data file.

@ralyodio
Copy link
Author

ralyodio commented Dec 9, 2016

is it possible to wait for the lock to be released?

@m4heshd
Copy link

m4heshd commented Jun 1, 2018

There should definitely be an unlocking mechanism since this is an essential feature.

@JamesMGreene
Copy link
Contributor

You may be interested in PR #535.

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

4 participants