Atomikos的使用过程中要注意的事

本文记录了在使用Atomikos进行分布式事务管理时遇到的问题,包括MySQL不支持TMJOIN的解决方案,设置`com.atomikos.icatch.serial_jta_transactions=false`无效的困境,以及通过修改MySQL数据源URL解决`pinGlobalTxToPhysicalConnection`属性问题。另外,还提到了MyBatis事务回滚的检查和连接池耗尽的配置调整建议。在Atomikos的故障恢复中遇到的日志文件损坏问题,通过升级Atomikos版本至4.0.4得以解决。
摘要由CSDN通过智能技术生成

在使用Atomikos过程中遇到的一些问题,以作记录:

MySQL does not support TMJOIN
MySQL does not allow for joining an existing XA transaction branch, as mentioned here:http://dev.mysql.com/doc/refman/5.0/en/xa-restrictions.html - the consequence is that one transaction accessing the same MySQL multiple times can run into problems like this:


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"  


  以上

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
非常抱歉,我看漏了没有在代码中显示使用Atomikos使用Atomikos时需要在Spring配置文件中进行配置,例如在applicationContext.xml文件中添加以下配置: ```xml <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce"> <property name="properties"> <props> <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop> <prop key="com.atomikos.icatch.log_base_name">./transaction_logs/mytransactions</prop> <prop key="com.atomikos.icatch.output_dir">./transaction_logs</prop> <prop key="com.atomikos.icatch.max_actives">50</prop> </props> </property> </bean> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"> <property name="forceShutdown" value="false"/> </bean> <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"> <property name="transactionTimeout" value="300"/> </bean> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager" ref="atomikosTransactionManager"/> <property name="userTransaction" ref="atomikosUserTransaction"/> <property name="allowCustomIsolationLevels" value="true"/> </bean> ``` 在使用Atomikos进行分布式务管理后,Spring框架会使用Atomikos提供的务管理器来管理分布式务。因此,在代码中使用@Transactional注解时,就可以实现分布式务的管理了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

^止境^

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值