-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
LiteException during Saving huge file to FileStorage #483
Comments
Here is simple solution to reproduce error: P.S. If you increase number of lines enough you'll get OOM from the related request. |
Hi @podkolzzzin, transaction are not supported inside FileStorage operations (read/write/delete). But until last release 3.0.1 there is no validation about this. Now I add check to avoid too memory usage. It´s because all modification during a transaction occurs in memory. Only when you commit, all dirty pages are write in this flushing memory. But I will check you test to check if there is another error about duplicate key. |
Oh, it's really unexpected behaviour. Is it written somewhere? P.S. I have written some new comments in #363, it's still reproducing. Please reopen it. |
My documentation are very weak. I always has no time and patience to update :) (and it´s quite hard to write in english to me). |
It's really not a problem to use LiteDB, it usually behaves very predictable and it's really cool. Some simple things can be easily detected investigating source code. But the issue with transactions was really unexpected. It would be enough to write just a small note in paragraph about FileStorage to inform everybody about this behaviour. |
@mbdavid Just to make sure. Is it a supported scenario when one thread creates a transaction and does normal operations and simultaneously other thread writes to FileStorage without a transaction? I have tested such a scenario in 3.0.0 and I was receiving very strange errors (not tested yet in 3.0.1). |
@mbdavid I have tested it in 3.0.1 and it seems not. I receive: "Transactions are not supported here: LiteFileStream" in one thread and "The read lock is being released without being held". I don't use transaction on the thread performing FileStorage operations. |
@mkosieradzki: I had a similar issue yesterday. I have multiple databases - some only used for filestorage. I found that a database with files only had active transactions (by looking at the count in the Engine). When I put a lock around my file writing the problem dissapears. |
Hi! With the objective of organizing our issues, we are closing old unsolved issues. Please check the latest version of LiteDB and open a new issue if your problem/question/suggestion still applies. Thanks! |
I worked with a really big file using FileStorage and received this during saving.
I used method FileStorage.OpenWrite to get LiteStream and then wrapped it with StreamWriter.
It's not the first line I'm trying to write. In fact it is 1532935th line.
The text was updated successfully, but these errors were encountered: