title: EntityFramework Transaction - Save to multiple tables
body: <p>Will the below code rollback the changes if there are any exception while saving? </p>
  
  <pre><code>using (SampleEntities context = new SampleEntities())
  {
      //Code Omitted
  
      context.EmpPercAdjustments.AddRange(pp);
      context.SampleJobs.AddRange(sampleJobs);
  
      context.SaveChanges();
  }
  </code></pre>
  
  <p>Or</p>
  
  <p>Do I need to use transaction?</p>
  
  <pre><code>using (SampleEntities context = new SampleEntities())
  {
      //Code Omitted
  
      using (System.Data.Entity.DbContextTransaction tranc = context.Database.BeginTransaction( ))
      {
          try
          {
              context.EmpPercAdjustments.AddRange(pp);
              context.SampleJobs.AddRange(sampleJobs);
              context.SaveChanges();
              tranc.Commit();
          }
          catch (Exception ee)
          {
              tranc.Rollback();
          }
      }
  }
  </code></pre>
  
  <p>Are there any advantages of using one over the others?</p>