title: Keep transaction between web service calls
body: <p>I have a webservice (Service.svc.cs) in ASP.NET 4.5.1.</p>
  
  <p>I have one method called
  "public string UploadData(Guid id, string[] data)"</p>
  
  <p>The client calls this method with strings and the server stores the data in a SQL-Server database, but does not commit or rollback this DbTransaction.</p>
  
  <p>The same client should then (for example 5 seconds later) call one of two other methods:
  "CommitData(Guid id)" or 
  "RollbackData(Guid id)"</p>
  
  <p>Depending on method, the server should commit or rollback the transaction. If the client does not call within 30 seconds, the transaction should be rolled back.</p>
  
  <p>I have tried storing the transaction in memory in server between calls, but the transaction gets corrupt. Some values in the transaction, like connection gets reset to null. So the commit or rollback does not work.</p>
  
  <p>What is the best way to preserve the System.Data.Common.DbTransaction between web service calls?</p>