title: EF6 Nested Transactions are not supported
body: <p>I'm trying to make a simple database insert for just one table, the insert and the connections are working perfectly.The problem appears only when the exceptions arise for entering bad data.</p>
  
  <p>Here is my code: (using MySql and EF6)</p>
  
  <pre><code>using (MaintenanceDB db = new MaintenanceDB())
          {
              try
              {
                  employee employee = new employee
                  {
                      ID = idTBA.textBox.Text,
                      EName = enTBA.textBox.Text,
                      AName = anTBA.textBox.Text,
                      CareerCode = careerCodeCBA.comboBox.SelectedItem.ToString(),
                      Specialization = specTBA.textBox.Text,
                      Mobile = mobileTBA.textBox.Text,
                      Telephone = teleTBA.textBox.Text,
                      Email = emailTBA.textBox.Text
                  };
                  db.employees.Add(employee);
                  db.SaveChanges();
              }
              catch (DbUpdateException exception)
              {
                  MessageBox.Show(exception.InnerException.InnerException.Message);
              }
              catch (EntityException exception)
              {
                  MessageBox.Show(exception.InnerException.Message);
              }
          }
  </code></pre>
  
  <p>so if the data entered correctly everything is smooth and fine, but if I entered duplicate ID for example the first time it's going to the first catch block and tell me there is a duplicate , at this point there is something wrong, it seems the connection isn't closed here (Despite using finally and dispose on db), the next time I hit the save button the error "Nested Transactions are not supported" appears, and then the db closes and I'm able to enter new data!</p>
  
  <p>I tried opening the connection manually or starting a transaction and closing it manually as I found in few posts here but nothing seems to solve the problem</p>