开发者社区 > 云原生 > 中间件 > 正文

为什么引入 seata 会导致数据库连接池中连接没有被回收呢?

请问引入 seata 之后,当数据库链接超过了数据库配置的 wait_timeout,再进行SQL查询操作,就会报 The last packet sent successfully to the server was **** milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. 这个异常,然后第二次查询就会正常。 初步估计问题根本就是连接池中链接没有回收,但是数据库自身链接已经回收,查询用的链接已经再数据库被回收,数据库报出此异常。这是为什么呢? 引入 seata 就会有这个问题,去掉 seata 就不会出现了。为什么引入 seata 会导致数据库连接池中连接没有被回收呢?使用seata会去修改 数据库的wait_timeout时间吗?

展开
收起
fuxixi 2022-10-17 12:57:26 464 0
1 条回答
写回答
取消 提交回答
  • 跟seata没有关系。此答案整理自钉钉群“3群-Seata开源讨论群”

    2022-10-17 14:41:40
    赞同 展开评论 打赏

为企业提供高效、稳定、易扩展的中间件产品。

相关电子书

更多
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载
云时代的数据库技术趋势 立即下载
超大型金融机构国产数据库全面迁移成功实践 立即下载