是否仍在使用XA/JTA交易? [英] Are XA/JTA transactions still used?

查看:133
本文介绍了是否仍在使用XA/JTA交易?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与多个数据库和一些自定义服务交互的应用程序.对于某些操作,我需要类似事务的行为,其中一组更改要么跨所有数据库/服务提交,要么在发生错误时全部回滚.

I have an application that interacts multiple databases and some custom services. For some operations, I need transaction-like behavior where a set of changes either commit across all databases/services or all roll back if an error occurs.

X/Open组的XA标准和Java JTA似乎使用两阶段提交过程完全解决了这个问题.一些数据库(mySQL,Postgres,Oracle)支持这些接口,但是我感到它们不经常使用或流行度下降.真的吗?如果是这样,为什么?

The XA standard from the X/Open group and the Java JTA seem to solve exactly this problem using a two-phase commit process. Some databases (mySQL, Postgres, Oracle) support these interfaces, but I get the feeling that they are not often used or declining in popularity. Is that true? And If so, why?

我知道在MySQL上XA存在一些与复制相关的问题.同样,XA事务可能会明显变慢. XA受欢迎/罕见的原因还有其他原因吗?

I know there were some replication-related issues with XA on mySQL. Also, XA transactions can be significantly slower. Are there any other reasons why XA is unpopular / uncommon?

推荐答案

XA有几点:

  • 它正在工作,没有公认的替代方案.如果您必须使用分布式事务,那么XA就无法解决.
  • 这是标准技术",没有大肆宣传,也没有行销.因此,它飞到了大多数人的雷达之下.
  • 即使使用它,由于大多数部分通常都隐藏在某些框架中,因此Jack Application Developer很有可能不知道它.
  • 对XA的需求确实在下降,因为面向服务的体系结构(SOA)和消息队列是被炒作的体系结构范例,可以尝试避免子系统之间的这种紧密耦合.尽管至少SOA似乎也下降得很好. ;-)
  • XA通常被遗忘的部分是在事务实际中断时使用的必需代码和工具. XA中有一些郊区,事务管理器在相当长的一段时间内既不能提交也不能回滚所有资源.这一点仅增加了仅在您确实需要时才使用"这一点.
  • It does its job and there is no accepted alternative. If you must use distributed transactions, then there is no way around XA.
  • It is "standard technology", no hype and no marketing. Therefore it flies below the radars of most people.
  • Even when it is used, there is a good chance that Jack Application Developer does not know it as most parts are usually hidden in some frameworks.
  • The need for XA is indeed somewhat on decline, because Service Oriented Architecture (SOA) and message queuing are hyped architecture paradigms which try to avoid such tight coupling of subsystems. Although at least SOA also seems to be declining quite well. ;-)
  • Often forgotten parts of XA are the required code and tools which are used when a transaction actually breaks. There are some outskirts in XA where the Transaction Manager can neither commit nor rollback all resources for quite some time. This point only increases the "use it only if you really must" point.

这篇关于是否仍在使用XA/JTA交易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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