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

[BUG] Multiple call of GetPlan method throw exeption #1681

Closed
mikhail-khalizev opened this issue May 12, 2020 · 1 comment
Closed

[BUG] Multiple call of GetPlan method throw exeption #1681

mikhail-khalizev opened this issue May 12, 2020 · 1 comment
Labels

Comments

@mikhail-khalizev
Copy link

Version
5.0.7

Describe the bug
Multiple call of GetPlan method throw LiteDB.LiteException : Maximum number of transactions reached

Code to Reproduce

public class Customer
{
    public string Login { get; set; }
    public string Name { get; set; }
}

[Fact]
public void CallGetPlanManyTimes()
{
    using (var db = new LiteDatabase(":memory:"))
    {
        var col = db.GetCollection<Customer>("col");
        col.Insert(new Customer { Name = "name1" });
        col.Insert(new Customer { Name = "name2" });
        
        for (var i = 0; i < 200; i++)
        {
            var query = col.Query().Where(x => x.Name == "name1");
            var plan = query.GetPlan();
        }
    }
}

Expected behavior
No exception thrown.

@lbnascimento
Copy link
Contributor

@mikhail-khalizev This issue has been fixed in master and its fix will be present in the next incremental release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants