title: Sql transaction is complete exception
body: <p>I have a strange problem. All documentation states that the <code>SaveChanges()</code> method must be first called before committing the transaction but in my case it is throwing an exception if done this way.
  By calling Commit before <code>SaveChanges()</code> I can avoid the "Sql transaction is complete exception"</p>
  
  <pre><code>    [HttpPost]
      public ActionResult ajax_SaveScreentest(string ScreenTestResult = "")
      {
  
          var shops = from m in db_emp.WorkLocations
                      where m.LocationType == "Shop"
                      select m;       
  
          db.Database.Connection.Open();
          using (var dbtran = db.Database.Connection.BeginTransaction())
          {
              try
              {
                  if (ScreenTestResult != "")
                  {
  
                      var sc = js.Deserialize&lt;ScreenTest&gt;(ScreenTestResult);
                      AppFieldValidator.Validate(sc);
                      db.Entry(sc).State = System.Data.EntityState.Added;
                      dbtran.Commit(); //needs to commit first before savechanges otherwise The sql                transaction is completed exception will occur
                      db.SaveChanges();
  
  
                      foreach (var obj in shops)
                      {
                          ScreenShop ss = new ScreenShop();
                          ss.ScreenID = sc.ID;
                          ss.ShopID = obj.WorkLocationID;
                          ss.ScreenStatus = "Outstanding";
                          ss.ScreenDateSubmitted = null;
                          db.Entry(ss).State = System.Data.EntityState.Added;
                      }
  
                      db.SaveChanges();
  
                      return Json(new { success = true, message = "" });
                  }
                  return Json(new { success = false, message = "Screen Test is not supplied" });
              }
  
              catch (Exception e)
              {
                  dbtran.Rollback();
                  if (e.Message.IndexOf("Validation failed for one or more entities.") != -1)
                      return Json(new { success = false, message = "One of the entries you made is      ether too long or unacceptable!" });
                  return Json(new { success = false, message = e.InnerException != null ?    e.InnerException.Message : e.Message });
              }
              finally
              {
                  db.Dispose();
              }
          }
  </code></pre>