【问题标题】:"error: 19 - Physical connection is not usable" when I swap my Staging and Production deployments on Windows Azure当我在 Windows Azure 上交换暂存和生产部署时出现“错误:19 - 物理连接不可用”
【发布时间】:2013-10-17 07:40:00
【问题描述】:

每次我在暂存和生产之间交换部署时,都会遇到这种错误:

[Wed Oct 09 18:43:51.9519 +00:00 2013] [错误] [Zappiti.BaseApi] An 更新条目时发生错误。请参阅内部异常 详情。

System.Data.Entity.Infrastructure.DbUpdateException:一个错误 更新条目时发生。请参阅内部异常 细节。 ---> System.Data.UpdateException: 发生错误时 更新条目。有关详细信息,请参阅内部异常。 ---> System.Data.SqlClient.SqlException:传输级错误有 从服务器接收结果时发生。 (提供者:会话 提供者,错误:19 - 物理连接不可用)

在 System.Data.SqlClient.SqlConnection.OnError(SqlException 异常, Boolean breakConnection, Action`1 wrapCloseInAction)

在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

在 System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj,UInt32 错误)

在 System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()

在 System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()

在 System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()

在 System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& 值)

在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler、SqlDataReader 数据流、 BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean & dataReady)

在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, 字符串 resetOptionsString)

在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、布尔 async,Int32 超时,Task& 任务,布尔 asyncWrite)

在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior、runBehavior、布尔返回流、字符串 方法,TaskCompletionSource`1 完成,Int32 超时,Task& 任务, 布尔异步写入)

在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 完成,字符串方法名,布尔型 sendToPipe,Int32 超时, 布尔异步写入)

在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

在 System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator 翻译器,EntityConnection 连接,Dictionary2 identifierValues, List1 generatedValues)

在 System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager,IEntityAdapter 适配器)

---内部异常堆栈跟踪结束---

在 System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager,IEntityAdapter 适配器)

在 System.Data.Objects.ObjectContext.SaveChanges(SaveOptions 选项)

在 System.Data.Entity.Internal.InternalContext.SaveChanges()

---内部异常堆栈跟踪结束---

在 System.Data.Entity.Internal.InternalContext.SaveChanges()

在 Zappiti.BaseApi.PutVideo(PutVideo putVideo, Guid userId, String queueName, Boolean isBeta)

我使用来自 TFS 的标准构建定义部署我的包。

有没有办法避免这些连接错误?

【问题讨论】:

  • 我得到了同样的错误,你有什么运气吗?
  • 我也是——这很烦人。有什么见解吗?
  • 到目前为止,我使用 try/catch 重试失败的 SaveChanges()。我重试 x 次,每次尝试之间都睡一觉。不完美,但它解决了 90% 的错误。

标签: azure tfs tfsbuild azure-web-roles


【解决方案1】:

我刚刚在 EF 6.x 的更新日志中发现了这个功能:

http://msdn.microsoft.com/en-us/data/dn456835

我试试看。

敬请期待。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-19
    • 1970-01-01
    • 2012-03-14
    • 2023-03-17
    • 1970-01-01
    • 2018-04-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多