Hi Arthur,
Thanks for your reply. We are inserting one row at a time in a loop, the loop is in a function which is called from many threads.
This is the NHibernate code
while (!_isDone) { using (var session = _sessionFactory.OpenSession ()) { using (var transaction = session.BeginTransaction ()) { var qrow = new row () { ThreadId = qthread_id, Text = qtext, Timestamp = qnow, Secs = qnow.Millisecond, }; session.SaveOrUpdate (qrow); transaction.Commit (); } } }
This is the EF6 code
while (!_isDone) { using (entities qdb = new entities ()) { var qrow = new row() { ThreadId = qthread_id, Text = qtext, Timestamp = qnow, Secs = qnow.Millisecond, }; qdb.Loads.Add (qrow); qdb.SaveChanges (); } }
We noticed a minor difference in the sql that is generated by NHibernate and EF6 (EF6 selects the RowCount).
Please let us know if we should do something different.
Thanks,
Mahesh Menghani @ axceler