Npgsql.Bulk icon indicating copy to clipboard operation
Npgsql.Bulk copied to clipboard

Double insert when SaveChanges after BulkInsert

Open ealeykin opened this issue 3 years ago • 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.

ealeykin avatar Jul 18 '22 21:07 ealeykin

Hannes has supplied some code - saved under GPML in my gmail - to be introduced

jamesrobertlloyd avatar Nov 04 '13 12:11 jamesrobertlloyd