Java 中有 XA 事务文件访问的开源解决方案吗?
是否可以在 Java 中对文件系统进行 XA 事务访问? 我想在事务边界内操作文件,并且我的事务必须通过 JTA 参与分布式事务(因此我猜想文件系统需要作为 XAResource 进行访问)。 我不需要支持细粒度的读/写文件访问; 将每个文件视为一条记录足以满足我的需求。
有人知道已经有这样做的开源项目吗? 我不想只是为了发现它已经完成而实施这个混乱......
我听到一些传言说 JBoss Transcations 将添加对此的支持(例如参见 此讨论),但找不到有关此问题的官方声明。
顺便说一句,如果您需要事务文件访问但不需要事务参与两阶段提交,我建议您查看 Apache Commons Transaction
有关所涉及复杂性的一篇好文章可以在 这里。
Is it possible to make XA-transactional access to the file system in Java?
I want to manipulate files within the boundaries of a transaction and my transaction must participate in a distributed transaction via JTA (so I guess the file system needs to be accesses as a XAResource). I don't need support for fine-grained read/write file access; treating each file as a record is good enough for my needs.
Does anybody know an open-source project that already does this? I don't feel like implementing this mess just to find out that it's already been done...
I heard some rumors that JBoss Transcations will add support for this (see for example this discussion) but couldn't find an official statement about this.
By the way, if you need transactional file access but don't require the transaction to participate in a 2-phase commit I recommend you have a look at Apache Commons Transaction
A nice article about the complexities involved can be found in here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
XADisk 可以为您提供所需的内容。 它是免费且开源的。
XADisk can get you what you are looking for. It's free and open source.
最近我解决了完全相同的问题。 最后我将 Bitronix 与 XADisk 结合使用。
您可以在我的博客文章中找到更多详细信息: JTA 事务经理 – Atomikos 还是 Bitronix?
Recently I solved exactly the same problem. Finally I used Bitronix with XADisk.
You can find more details in my blog post: JTA transaction manager – Atomikos or Bitronix?
当 JBoss Transactions 实习生开始工作时,还没有适用于 Java 的支持 XA 的文件系统驱动程序。 我最近没有查过,但也没有看到任何有关类似工作的新闻。 如果您想使用 Ioannis 在实习期间所做的工作,您可以使用它,但目前尚未积极开发。 除非您想成为开源贡献者:-)
在将来的某个时候,当我们有时间和/或客户需求时,我们可能会将此功能引入到产品中。 同时,它位于 www.jboss.org/jbosstm/fileio/ ,原始项目讨论是在www.jboss.org/community/wiki/JBossTSProjects
乔纳森哈利迪
JBossTS 开发团队
At the time the JBoss Transactions intern started there was no XA capable file system driver for Java. I've not checked more recently, but nor have I seen any news about similar work. The work that Ioannis did during his internship is available if you want to use it, but not under active development at present. Unless you want to become an open source contributor :-)
At some point in the future when we have the time and/or customer demand we may roll this functionality into the product. Meanwhile it's at www.jboss.org/jbosstm/fileio/ and the original project discussion is at www.jboss.org/community/wiki/JBossTSProjects
Jonathan Halliday
JBossTS dev team
在 Atomikos,我们大约 10 年前就这样做了,但由于缺乏需求而放弃了这个想法。
如果有足够的理由,我们可以恢复我们的努力。
At Atomikos we did this about 10 years ago but dropped the idea due to lack of demand.
We could resume our efforts if there is sufficient reason to do so.