简体   繁体   中英

async await fatal error 3624

I have a method similar to

public async Task<SaveResult> SaveStatus(int quotationId, int quotationStatusTypeId)
{
   using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
   {
      var offerQuotation = await RevisionManager.ReviseOffer(quotationId);
      var offerQuotationStatusModel = DataUnit.GetCurrentOfferQuotationStatus(offerQuotation.quotationId);
      scope.Complete();
   }
}

public async Task<DTO.OfferQuotation> ReviseOffer(int quotationId)
{
  //......
}

Sometimes this method GetCurrentOfferQuotationStatus throws an exception:

ERROR An error occurred while executing the command definition. See the inner exception for details.
EXCEPTION OCCURRED:System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.

System.Data.SqlClient.SqlException: Warning: Fatal error 3624 occurred at Dec 6 2016 7:05PM. Note the error and time, and contact your system administrator.

A severe error occurred on the current command. The results, if any, should be discarded.

The method GetCurrentOfferQuotationStatus looks like

public Model.OfferQuotationStatus GetCurrentOfferQuotationStatus(int? offerQuotationId)
{
  return Context.OfferQuotationStatuses.Include(x => x.OfferQuotationStatusType).FirstOrDefault(x => x.IsActive && x.OfferQuotationId == offerQuotationId);
}

It seems quite clear to me:

Warning: Fatal error 3624 occurred at Dec 6 2016 7:05PM. Note the error and time, and contact your system administrator. A severe error occurred on the current command. The results, if any, should be discarded.

Something serious – potentially fatal – has gone wrong on your database server. Talk to your DBA now . (If you are the DBA, head over to https://dba.stackexchange.com/ and other places where you can get more details of the actions you should be talking.)

There is no indication that your code has a problem.

I am posting this in hopes this may help someone else. I had a similar error, the issue was a corrupt user account in SQL Server. We deleted the account and re-added it and it resolved the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM