using (var txn = context.Database.BeginTransaction()) { BISaveTransaction.CommitTransactions(context,rs); modulate(); processTransactionHeader(); processTransactionDetails(); if (or.Success == false) { Monitor.write($" ===> Rolling back - {t.Document}" ); txn.Rollback(); return; } processRsHeaders(); processEmHeaders(); txn.Commit(); th_Id = th.TransactionHeaders_Id; }When or.Success returns false after process TransactionDetails, updates of OnHand fields of related tables are not rolled back.