-1

I am getting a timeout error thrown. How can I increase the amount of time before the transaction times out?

            Database dbSvc = DatabaseFactory.CreateDatabase();

            //use one connection
            using (DbConnection conn = dbSvc.CreateConnection())
            {
                conn.Open();
                DbTransaction transaction = conn.BeginTransaction();           
                try
                {
                    ....
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    ret.IsSuccess = false;
                    ret.ExceptionInfo = ex;
                }
                finally
                {
                    ret.InvoiceInfo = invoiceOut;
                }

Thanks!

user1634700
  • 165
  • 3
  • 12

1 Answers1

0

If you are using ADO.Net add timeout property to your connection string. Increase accordingly until it no longer times out, but generally if you are adding a timeout property you should be looking at your db and analyzing weaknesses such as lack of indexes this can be done via analyzing your queries via the sql profilier.

Bill Blankenship
  • 3,316
  • 6
  • 43
  • 73