Normal
Just a quick point about iterations. When using Entity Framework and LINQ you commit changes by calling SaveChanges() on the connection handle.It makes a dramatic difference if you put the SaveChanges inside an iterative loop, after each update, as opposed to placing it after the loop has finished but before closing the using scope. The difference is astonishing - by factors of over a hundred, I suspect. using (var sql = new SQLite.NET.SQLiteClient(@"D:\klad\sqlitetest\sqlitetest\PictureDatabaseV3_1.db3")) { for (int i = 0; i < 1000; i++) { var res = sql.Execute("update picturedata set blah = 1 where idpicture=3856"); SaveChanges(); //bad } SaveChanges(); // good }
Just a quick point about iterations. When using Entity Framework and LINQ you commit changes by calling SaveChanges() on the connection handle.
It makes a dramatic difference if you put the SaveChanges inside an iterative loop, after each update, as opposed to placing it after the loop has finished but before closing the using scope. The difference is astonishing - by factors of over a hundred, I suspect.
using (var sql = new SQLite.NET.SQLiteClient(@"D:\klad\sqlitetest\sqlitetest\PictureDatabaseV3_1.db3"))
{
for (int i = 0; i < 1000; i++)
var res = sql.Execute("update picturedata set blah = 1 where idpicture=3856");
SaveChanges(); //bad
}
SaveChanges(); // good