为什么引入 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 576 分享 版权
1 条回答
写回答
取消 提交回答
  • 跟seata没有关系。此答案整理自钉钉群“3群-Seata开源讨论群”

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

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

收录在圈子:
+ 订阅
阿里云中间件主要有包含这么几个: 分布式关系型数据库DRDS_水平拆分 做数据库扩展性的 、消息队列MQ 是做消息的中间件、企业级分布式应用服务EDAS 做分布式服务的、还有一些其他的中间件,比如配置服务、缓存等等。

热门讨论

热门文章

还有其他疑问?
咨询AI助理