今天把分布式事务弄好以后,后面一直报连接错误
先来说这个错误:XA resource 'XXXXdatasource': end for XID '' raised -7: the XA resource has become unavailable
这个算是mysql对于Atomikos的一个小bug
官方的解释:
A possible workaround might be to try and start TransactionsEssentials with the parametercom.atomikos.icatch.serial_jta_transactions set to false.
com.atomikos.icatch.serial_jta_transactions=false
Also, make sure to set the following property on the MySQL datasource:
pinGlobalTxToPhysicalConnection="true"
我在试了com.atomikos.icatch.serial_jta_transactions这个以后,还是一样的,没有任何反应。照常报错,数据库还是一直连接不,第一次登陆访问数据库都不行
于是换一种方式pinGlobalTxToPhysicalConnection="true";
但是我是用的druid,也挺无奈,于是在url上面添加了一段,惊奇的发现。卧槽,居然可以了
---------------------
作者:ypp91zr
来源:CSDN
原文:https://blog.csdn.net/ypp91zr/article/details/83994305
版权声明:本文为博主原创文章,转载请附上博文链接!