关于JTA事务

事务管理器与数据库连接的关系

特别是JTA事务与数据库Connection之间的关系。

java事务分为JDBC事务即驱动自带的事务管理器和JTA事务,JTA事务常见的实现有JBoss的事务管理器和JOTM实现,前者常与Jboss数据源结合使用(包括JBoss实现的数据库连接池),后者与xapool(支持分布式事务)配合使用。

 

当出现高并发事务,同一事务内操作,前面插入的数据后面查询不出来,原因很可能是一个事务内的连接被切换了,出现这种问题的原因是事务内的连接没进行管理。目前spring已经提供比较好的管理实现,可以参考使用。

经验证JOTM与XAPool结合并不稳定,存在较多不确定性稳定。

Open source JTA implementations

There exist a number of active (as of September 2010) open source JTA implementations.

JBossTS

JBossTS, formerly known as Arjuna Transaction Service, comes with a very robust implementation, which supports both the JTA and JTS APIs. JBossTS comes with a recovery service, which could be run as a separate process from your application processes. JBossTS is the default transaction manager for JBoss AS. It does not support out-of-the box integration with the Spring framework, but it is easy to integrate.

Atomikos TransactionsEssentials

Atomikos TransactionsEssentials's documentation and literature on the internet show that it is a production quality implementation, which also supports recovery and some exotic features beyond the JTA API. Atomikos provides out-of-the-box Spring integration along with some nice examples. It also provides support for pooled connections for both database and JMS resources.

Bitronix JTA

Bitronix claims to support transaction recovery as well as or even better than some of the commercial products. Bitronix also provides connection pooling and session pooling out of the box.

转载于:https://www.cnblogs.com/yaohonv/archive/2013/01/25/TransactionManager-jotm-xspool.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值