I am new to JTA and it's underlying transaction managers. Can anyone explain the pros/cons of each of these? Feel free to add others I didn't list in title.
I've never tested them all extensively (and this is what you would have to do if you have to choose one) so I can't provide an exhaustive pros/cons (and that would require some work). But here are some links:
I have tested Atomikos and JOTM with Jetty. Atomikos worked fine and I fully recommend it. I made e.g. automated unit tests for testing distributed transactions in my application and these tests worked fine.
As far as JOTM is concerned I am quite sure that it fakes the 2-phase commit protocol at least sometimes. I had a PostgreSQL database with the 2-phase commit capabilities turned off and JOTM was able to work as if I had real distributed transactions. Real transaction managers (e.g. the one implemented in GlassFish) reported an error in such a case.
I used JPA2 with Hibernate 4 in my application if it matters.
发布评论
评论(2)
我知道的独立事务管理器包括 Bitronix、SimpleJTA,Tyrex(死了?), JOTM(用于乔纳斯),GeronimoTM/Jencks(在 Geronimo 中使用)、JBossTS (在 JBoss 中使用)和 Atomikos。
我从未对它们进行过广泛的测试(如果你必须选择其中一个,这就是你必须做的),所以我无法提供详尽的优点/缺点(这需要一些工作)。但这里有一些链接:
以防万一,这是我个人的观点:
就我个人而言,如果我必须选择其中之一,我会入围 Atomikos 和 JBossTS,并对它们进行硬核测试。
当然可以,JTA 是 Java EE 规范的一部分,Java EE 服务器必须支持它。
不,我会使用提供的事务管理器(为了简单、支持等)。
Standalone transaction managers I'm aware of include Bitronix, SimpleJTA, Tyrex (dead?), JOTM (used in Jonas), GeronimoTM/Jencks (used in Geronimo), JBossTS (used in JBoss) and Atomikos.
I've never tested them all extensively (and this is what you would have to do if you have to choose one) so I can't provide an exhaustive pros/cons (and that would require some work). But here are some links:
Just in case, here is my very personal point of view:
Personally, I'd shortlist Atomikos and JBossTS and test them hardcore if I had to choose one.
Of course they do, JTA is part of the Java EE specification, a Java EE server has to support it.
No, I'd use the provided transaction manager (for simplicity, support, etc).
我已经用 Jetty 测试了 Atomikos 和 JOTM。 Atomikos 工作得很好,我完全推荐它。我做了自动化单元测试来测试我的应用程序中的分布式事务,这些测试工作得很好。
就 JOTM 而言,我非常确定它至少有时会伪造两阶段提交协议。我有一个 PostgreSQL 数据库,关闭了两阶段提交功能,JOTM 能够像我有真正的分布式事务一样工作。真实的事务管理器(例如,在 GlassFish 中实现的事务管理器)在这种情况下会报告错误。
如果重要的话,我在我的应用程序中将 JPA2 与 Hibernate 4 一起使用。
I have tested Atomikos and JOTM with Jetty. Atomikos worked fine and I fully recommend it. I made e.g. automated unit tests for testing distributed transactions in my application and these tests worked fine.
As far as JOTM is concerned I am quite sure that it fakes the 2-phase commit protocol at least sometimes. I had a PostgreSQL database with the 2-phase commit capabilities turned off and JOTM was able to work as if I had real distributed transactions. Real transaction managers (e.g. the one implemented in GlassFish) reported an error in such a case.
I used JPA2 with Hibernate 4 in my application if it matters.