使用atomikos作JTA事务,服务器io高的问题

OliveTree 发布于 2013/11/01 21:59
阅读 1K+
收藏 0

项目为b/s架构,使用了spring、hibernate;有三个mysql数据库,分别在不同的机器上(内网);在使用atomikos作JTA事务后,发现系统很慢,打开页面经常链接超时,而且应用服务器io高的离奇,都在90%以上,打印系统堆栈,发现很多线程是阻塞状态:

"http-apr-2010-exec-42" daemon prio=10 tid=0x00007fd9a80a9000 nid=0x5b21 waiting for monitor entry [0x00007fd957c58000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.atomikos.persistence.imp.StreamObjectLog.delete(StreamObjectLog.java:191)
	- waiting to lock <0x0000000784932210> (a com.atomikos.persistence.imp.StreamObjectLog)
	at com.atomikos.persistence.imp.StateRecoveryManagerImp.preEnter(StateRecoveryManagerImp.java:103)
	at com.atomikos.finitestates.FSMImp.notifyListeners(FSMImp.java:186)
	at com.atomikos.finitestates.FSMImp.setState(FSMImp.java:274)
	- locked <0x00000007780f8fa8> (a com.atomikos.finitestates.FSMImp)


事务管理器用spring的jta事务管理:

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="userTransactionService">
	<property name="transactionManager" ref="atomikos" />
	<property name="userTransaction" ref="userTransaction" />
</bean>

事务的传播用spring的拦截方式实现:

<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
……

加载中
返回顶部
顶部