zzzprojects / nmemory

NMemory is a lightweight non-persistent in-memory relational database engine that is purely written in C# and can be hosted by .NET applications.
https://nmemory.net/
MIT License
232 stars 62 forks source link

Error code: GenericError after insert 10M rows #56

Open ednsinf opened 1 month ago

ednsinf commented 1 month ago

Error code: GenericError after insert 10M rows in loop for

at NMemory.Tables.Table2.Insert(TEntity entity, Transaction transaction) at NMemory.Tables.Table2.Insert(TEntity entity)

Recomendation to fix: use buferred stream and flush in database stream

JonathanMagnan commented 1 month ago

Hello @ednsinf ,

We didn't get any error even after inserting 20M rows:

MyDatabase myDatabase = new MyDatabase();

for(int i = 0; i < 20000000; i++)
{
    myDatabase.Tests.Insert(new Test() { Id = i, Term1 = "z_1", Term2 = "z_2" });
}

Please ensure to include a project like we ask when you create a new issue.

Depending on what you are looking for, they might have a better alternative than nmemory such as SQLite InMemory.

Best Regards,

Jon