Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

System.Data.SqlClient.SqlException: Timeout expired #7978


User avatar
0
ale1648604090 created
I have a question,My first request was normal, but the second time I made a mistake

Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: Unknown error 258 --- End of inner exception stack trace --- at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__122_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary2 parameterValues, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Abp.EntityFrameworkCore.AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.Zero.EntityFrameworkCore.AbpZeroCommonDbContext3.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesInDbContextAsync(DbContext dbContext) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesAsync() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.CompleteUowAsync() at Abp.Domain.Uow.UnitOfWorkBase.CompleteAsync() at Abp.Domain.Uow.UnitOfWorkInterceptor.<>c__DisplayClass6_0.<<PerformAsyncUow>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func1 postAction, Action1 finalAction) at Abp.Threading.InternalAsyncHelper.AwaitTaskWithFinally(Task actualReturnValue, Action`1 finalAction) at GollumPay.Web.PayWeb.Controllers.OrderPayController.PayAction(PayApiRequest payApiRequest) in D:\Project\GollumPay\GollumPayTrunk_1.0\src\GollumPay.Web.PayWeb\Controllers\OrderPayController.cs:line 238

Method first executed by CreatePayOrderAsync,I don't know if it is the impact of CurrentUnitOfWork.SaveChanges();


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    The first time you call the CreatePayOrderAsync method is successful. Then call the UpdatePayOrderAsync method and pass the previous Id with an error, right?

    Please share the complete code of the UpdatePayOrderAsync method...

  • User Avatar
    0
    ale1648604090 created

    the UpdatePayOrderAsync Method:

                public async Task UpdatePayOrderAsync( UpdatePayOrderInput input )
                {
                if (!input.Id.HasValue)
                    return;
    
                var payOrder = await _payorderRepository.GetAsync( input.Id.Value );
                if (input.ContainerId.HasValue)
                {
                    payOrder.ContainerId = input.ContainerId;
                }
    
                if (input.PayPlanId.HasValue)
                {
                    payOrder.PayPlanId = input.PayPlanId;
                }
    
                if (input.OrderPayPlanType.HasValue)
                {
                    payOrder.OrderPayPlanType = input.OrderPayPlanType;
                }
    
                if (!input.OrderPayId.IsNullOrEmpty())
                {
                    payOrder.OrderPayId = input.OrderPayId;
                }
    
                if (!input.TransactionId.IsNullOrEmpty())
                {
                    payOrder.TransactionId = input.TransactionId;
                }
    
                if (input.IsVerify.HasValue)
                {
                    payOrder.IsVerify = input.IsVerify.Value;
                }
    
                await  _payorderRepository.UpdateAsync( payOrder );
                //await CurrentUnitOfWork.SaveChangesAsync();
            }
    

    When I execute UpdatePayOrderAsync for the second time, I get an exception prompt.

  • User Avatar
    0
    maliming created
    Support Team

    hi ale1648604090 Can I take a look at it remotely? If you have qq, please contact me: 4456337

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.