When working with the Entity Framework, the submission of changes to the database is automatically handled within a transaction when you call the SaveChanges
method on the ObjectContext object. Also, the AcceptAllChanges method is automatically called if no exception is thrown when updating, which will reset the state of all objects to Unchanged. The AcceptAllChanges
method is useful in the scenario where a transaction has failed and a user wants to retry.