title: Entity Framework bulk insert with transaction management - Performance
body: <p>I followed the answer in the following link for improving the performance of entity framework for bulk inserts and updates.</p>
  
  <p><a href="https://stackoverflow.com/questions/6107206/improving-bulk-insert-performance-in-entity-framework">Improving bulk insert performance in Entity framework</a></p>
  
  <ol>
  <li>Made save changes in batch of 1000</li>
  <li>regeneration of the <code>DbContext</code> object after every save changes</li>
  </ol>
  
  <p>I got the performance boost as expected.</p>
  
  <p>But I have a requirement of rolling back the transaction while exception condition while performing bulk insert.</p>
  
  <p>This becomes issue when we re initialize the <code>DbContext</code> object.</p>
  
  <p>Is there any other way to use the transaction and rollback with the same setup under the exception condition?</p>
  
  <p>Any help will be appreciated</p>