Atomikos JTA for Hibernate3

阅读更多
http://wiki.atomikos.org/bin/view.pl/Main/HibernateIntegration#With_Spring

http://www.hibernate.org/hib_docs/v3/reference/en/html/transactions.html#transactions-connection-release

经过多次试验, 下面的配置是最合适的 (OpenSessionInView Works fine)

jta.properties
com.atomikos.icatch.service = com.atomikos.icatch.standalone.UserTransactionServiceFactory

#Do you want transaction logging to be enabled or not?
#If set to false, then no logging overhead will be done
#at the risk of losing data after restart or crash.
#Note: this setting may be overridden depending on your license!
com.atomikos.icatch.enable_logging = false
com.atomikos.icatch.automatic_resource_registration = true


xa datasource and jta transaction manager
	
		XADBMS
		
			com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
		
		
			url=${jdbc.url};user=${jdbc.username};password=${jdbc.password};pinGlobalTxToPhysicalConnection=true
		
		false
		10
	


	
		
		
		
            
            classpath:/com/coheg/
            
        
		
			
				true ${boolean.true.value}, false ${boolean.false.value}, yes ${boolean.true.value}, no ${boolean.false.value}
				${hibernate.dialect}
				${hibernate.show_sql}
				true
				
				jta		
				org.hibernate.transaction.JTATransactionFactory	
				after_statement
			
		
	
	

	
	
		
		true
	
	
	 
	
	    120000
	
	
	
	
		
		
	
	



hibernate2 不支持 Connection Release Mode 概念, 在使用 JTA + OpenSessionInView 时会出一些问题

你可能感兴趣的:(Spring,Hibernate,JDBC,MySQL,thread)