zoukankan      html  css  js  c++  java
  • MySql.Data.MySqlClient.MySqlProtocolException:“Packet received out-of-order. Expected 1; got 2.”

    环境为:

    dotnet core 3.1 webapi efcore

    maridb 10

    Pomelo.EntityFrameworkCore.MySql

    解决方案:

    await _context.SaveChangesAsync();

    异步操作要加await,不然会出现此异常。

    参考:https://github.com/mysql-net/MySqlConnector/issues/496

    It is not permitted to have multiple in-flight async operations on the same connection at the same time; you do have to await any existing operation before starting a new one.
    However, you should also get a more helpful exception message (better than Packet received out-of-order) that helps you understand the problem and fix it. So if you are able to get a repro or a code sample that shows the problem, that would be good as it could help me identify where there is a missing check (for this invalid behaviour) in the code.
    不允许同时在同一连接上进行多个进行中异步操作;您必须await任何现有的异步操作然后再开始一个新的操作。
    但是,您还应该获得一条更有用的异常消息(比Packet received out-of-order这有助于你理解并解决问题。因此,如果您能够获得显示问题的repro或代码示例,那将是很好的,因为它可以帮助我识别代码中缺少检查(这种无效行为)的位置。

  • 相关阅读:
    【NX二次开发】Block UI 组
    【NX二次开发】Block UI 双精度表
    【NX二次开发】Block UI 整数表
    自己写的简单的轮播图
    微信分享到朋友圈----摘录
    HTML5比较实用的代码
    苏格拉底的名言警句
    jQuery 幻灯片 ----摘录
    DeDe调用指定栏目ID下的文章
    JQuery 判断ie7|| ie8
  • 原文地址:https://www.cnblogs.com/OnlyDreams/p/12157199.html
Copyright © 2011-2022 走看看