根据“尽力而为1PC”实现Spring ChainedTransactionManager。图案 [英] Implementing Spring ChainedTransactionManager according to the "best efforts 1PC" pattern

查看:157
本文介绍了根据“尽力而为1PC”实现Spring ChainedTransactionManager。图案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最好的努力1PC在这篇文章。为SpringSource工作的作者David Syer提供了一个 ChainedTransactionManager 的实现,扩展了Spring AbstractPlatformTransactionManager 类。

The best effort 1PC is nicely described in this post. The author, David Syer, who works for SpringSource, provided an implementation of a ChainedTransactionManager extending the Spring AbstractPlatformTransactionManager class.

此特定事务管理器可以启动 n 事务,例如JDBC或JMS会话,并使用 n执行提交/回滚 AbstractPlatformTransactionManager 的实例,每个资源一个。这在XA驱动程序不可用的情况下非常有用。由于帖子很老,代码在Spring 2.5中运行良好,但在Spring 3+中失败了。

This particular transaction manager can start n transactions, e.g., JDBC or JMS sessions, and perform commit/rollback using n instances of AbstractPlatformTransactionManager, one per resource. This is very useful where XA drivers are not available. Since the post is very old, the code works fine with Spring 2.5, but it fails with Spring 3+.

请求票在Spring 3+中实现类似的功能。我愿意尝试一下,但我想我先问:那里有没有实现?

There is a request ticket to implement a similar feature in Spring 3+. I'm willing to give it a try but I thought I'd ask first: are there any implementations out there?

谢谢

推荐答案

正如Luciano建议的那样,我在 ChainedTransactionManager 中找到了一个完美的实现方法:

As suggested by Luciano, I found a perfectly working implementation of ChainedTransactionManager in:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-neo4j-tx</artifactId>
  <version>2.2.0.RELEASE</version>
</dependency>

班级名称: org.springframework.data.neo4j.transaction.ChainedTransactionManager

编辑

ChainedTransactionManager 现在是版本1.6.1

这篇关于根据“尽力而为1PC”实现Spring ChainedTransactionManager。图案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆