title: Table lock while transaction is not committed in Entity Framework?
body: <p>I have come up with a scenario in which I am saving data using transaction using Entity Framework in C#. The table lock while it is not commit. I am using below code to save data.</p>
  
  <pre><code>tblCharge obj = new tblCharge();
  obj.Plan = "DD";
  obj.TotalAmount = 1500;
  
  // Opening transaction
  using (System.Data.Common.DbTransaction transaction((IObjectContextAdapter)dbContext).ObjectContext.Connection.BeginTransaction())
  {
       dbContext.tblCharges.Add(obj);
       dbContext.SaveChanges();
       transaction.Commit();
  }
  </code></pre>
  
  <p>When I am saving data before commit and I make selection query from table in SQL Server, it doesn't show results till the transaction commit. </p>
  
  <p>Is there any way that table locking not occur while using transaction?</p>