-
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
version V4 to V5 Problem #1428
Comments
@saeedrasti hi! |
Error message |
Are you using "upgrade=true" in your string connection? You can try use LiteDB.Studio also |
No , I’m checking now .
…On Sun, Feb 2, 2020 at 15:56 Mauricio David ***@***.***> wrote:
Are you using "upgrade=true" in your string connection? You can try use
LiteDB.Studio also
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1428>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4J7U36UM3AKCW37RVLZD3RA23XNANCNFSM4KOVJY7A>
.
|
👍 Converted success , Thanks a lot. |
I'm closing the issue then :) |
Even after using
Translated to English the error message reads something like:
Any idea what might cause this? I've ensured that no other thread holds any Edit 1I've further inspected: The first call to
The original "content.db" file remains untouched/unchanged. The next time I use Maybe I misunderstand how the upgrade is intended to work? Edit 2Even when trying to use After digging further, I discovered that a call to Since I'm doing this in a ThreadPool thread, I added Manually breaking in debugger and switching to the originally thread, I see that the
Edit 3I've reverted back to 4.1.4. Everything works again, correctly, even my newly added |
@UweKeim, I'm checking this.... |
@UweKeim, I'm try to simulate your problem but I didn't get this error. Can you fork and write how did you get the error? |
Thank you very much, Mauricio. I'll try to build a proof-of-concept and hope to be able to isolate the erroneous behaviour (in hope that this is not something specific to my development machine). |
Okay, I've created a simple .NET 4.8 console application: internal static class Program
{
private static void Main()
{
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
@"content.db");
LiteEngine.Upgrade(path);
Console.WriteLine(@"Finished.");
}
} Here, the error does not occur. So it must be something inside my "real" application. Will investigate further now. Edit 1I've even tried it in a background thread: var path = Path.Combine(
Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
@"content.db");
var e = new AutoResetEvent(false);
var did = false;
ThreadPool.QueueUserWorkItem(
delegate
{
did = LiteEngine.Upgrade(path);
e.Set();
});
e.WaitOne();
Console.WriteLine($@"Converted?: {did}."); Still succeeds, though. 🤔 |
have same issue, lots of tests started failing with this error upon upgrade. How the test looks:
var db = new LiteDatabase(connectionString);<--- throws exception. underneath |
Hi @Pokis, is not missing "upgrade=true" in connection string (if you want upgrade from v4 database). I added this options in connection string because check for upgrade have a cost (need open datafile, check some bytes and close datafile). |
These tests create new database, not upgrade it, thus it's not used in here. I've applied it in necessary places. |
@Pokis Just a wild guess, but is it possible that your antivirus/antimalware software is keeping a look on it? Have you tried excluding the folder? |
checked just in case, disabling antivirus does not help. But it does work with version 4.1.4 just fine (same tests in same solution). Another note, get operations works fine, while store operations throw the mentioned exception. |
FYI, after I upgrade LiteDB from v4 to v5, I encountered the same exception saying "process cannot access the file." Then I added "Connection=Shared" to connection strings, as below:
The exception was gone now. |
Note that in my case I did try Unfortunately the exception stills occurs intermittently :( Back to 4.1.4 for now... |
works for me with 5.0.7
|
using will try without the using on windows server 2016 under IIS + ASP.NET MVC 5 in asynchronouse and sync+async requests |
still throws exception but another one (was fine on V4). configuration is the following:
first upgrade connection string then:
|
@okarpov Could you try with v5.0.8? There were changes to the mutex access. |
seems fine will give it a little bit more time to test thx! |
Can't open version 4 db file in LIteDB 5.
The text was updated successfully, but these errors were encountered: