Closed ciscoheat closed 9 years ago
Hi Andreas,
Yes, exactly. It needs to be one Node instance for one file. It's because, it maintains an in-memory lock for each file it writes to.
Ok, that's good to know. I had some strange occurrences when using steno with two different files in the same instance as well. If I did some alternate writing to the files, only one of them saved to disk. When I wrote to only one of them, no problem regardless which one I wrote to. Would this be related?
Not really, it would be a bug. Steno should be able to handle multiple files in the same instance. Do you have a failing code so that I can reproduce?
I'm in the middle of debugging it now actually. It seems like the call to fs.writeFile(tmpFile, data, function(err) {
(around line 36) is never completed. Very strange since it worked with another file recently. I will try some more, and see if I can extract a reproducible case.
Awesome thanks :)
I've done some more testing, I was using steno together with a transaction-like scenario (restoring the DB automatically if an operation failed) and probably pushed it too hard, or created some race-condition. When I saved less frequently or used it synchronously it worked, but it made me realize I need to use another database solution. Which made me find OrientDB, so a good thing came out of it at least. :)
Hello, does this mean that I cannot run two Node instances that uses steno on the same file simultaneously?