I have DbContextTransaction that does a commit at some point.
using (DbContextTransaction transaction = dataContext.Database.BeginTransaction())
{
try
{
.
.
transaction.Commit();
}
catch (Exception ex)
{
transaction.Rollback();
throw;
}
}
and I want to increase the timeout for the commit operation. I read that it's very short and I had some timeout issues with that. How can I do it?
this is the error I'm getting
Exception Message[An error was reported while committing a database transaction but it could not be determined whether the transaction succeeded or failed on the database server. See the inner exception and http://go.microsoft.com/fwlink/?LinkId=313468 for more information.] Type[System.Data.Entity.Infrastructure.CommitFailedException] - System.Data.Entity.Infrastructure.CommitFailedException: An error was reported while committing a database transaction but it could not be determined whether the transaction succeeded or failed on the database server. See the inner exception and http://go.microsoft.com/fwlink/?LinkId=313468 for more information. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
--- End of inner exception stack trace ---
Thanks!