neisbut/Npgsql.Bulk

Double insert when SaveChanges after BulkInsert

Opened this issue · 1 comments

var uploader = new BulkUploader(context);
uploader.Insert(items); // first insert
context.SaveChanges(); // will insert items one more time

The snippet above shows minimal steps to reproduce, basically after bulk insert the state of entries remains Added and subsequent call to SaveChanges will apply all the changes (entries Added) one more time.

I've got the same issue on 0.10.3.
EF Core 3.1.7

UPD:
It works when disableEntitiesTracking is set to true.
Why do we need this parameter?
In what cases it must be set to false?