在Java中是否有XA事务文件访问的开源解决方案? [英] Is there an open-source solution to XA-transactional file access in Java?

查看:118
本文介绍了在Java中是否有XA事务文件访问的开源解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Java中对文件系统进行XA事务访问?
我想操纵事务边界内的文件,我的事务必须通过JTA参与分布式事务(所以我猜文件系统需要作为XAResource访问)。我不需要支持细粒度的读/写文件访问;把每个文件作为一个记录是足够我的需求。

有没有人知道一个已经这样做的开源项目?我不想为了发现它已经完成而实施这个混乱...

我听到一些传言说JBoss Transcations会增加对此的支持(请参阅例如这个讨论),但是找不到关于这个的官方声明。



顺便说一下,如果你需要事务性文件访问,但不需要事务参与到两阶段提交中,那么我建议你看一下 Apache Commons Transaction



一篇关于复杂性的好文章可以在这里找到。

解决方案

最近我解决了完全相同的问题。最后我用XADisk使用 Bitronix



您可以在我的博客文章中找到更多详细信息: JTA交易经理 - Atomikos或Bitronix?


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.

解决方案

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?

这篇关于在Java中是否有XA事务文件访问的开源解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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