本文主要是介绍spring学习10-Application server-specific integration(具体的事物配置 结合特定的应用服务器),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Spring’s transaction abstraction generally is application server agnostic. Additionally, Spring’s JtaTransactionManager
class, which can optionally perform a JNDI lookup for the JTA UserTransaction
and TransactionManager
objects, autodetects the location for the latter object, which varies by application server. Having access to the JTATransactionManager
allows for enhanced transaction semantics, in particular supporting transaction suspension. See the JtaTransactionManager
Javadocs for details.
Spring’s JtaTransactionManager
is the standard choice to run on Java EE application servers, and is known to work on all common servers. Advanced functionality such as transaction suspension works on many servers as well — including GlassFish, JBoss and Geronimo — without any special configuration required. However, for fully supported transaction suspension and further advanced integration, Spring ships special adapters for WebLogic Server and WebSphere. These adapters are discussed in the following sections.
For standard scenarios, including WebLogic Server and WebSphere, consider using the convenient <tx:jta-transaction-manager/>
configuration element. When configured, this element automatically detects the underlying server and chooses the best transaction manager available for the platform. This means that you won’t have to configure server-specific adapter classes (as discussed in the following sections) explicitly; rather, they are chosen automatically, with the standard JtaTransactionManager
as default fallback.
On WebSphere 6.1.0.9 and above, the recommended Spring JTA transaction manager to use is WebSphereUowTransactionManager
. This special adapter leverages IBM’sUOWManager
API, which is available in WebSphere Application Server 6.0.2.19 and later and 6.1.0.9 and later. With this adapter, Spring-driven transaction suspension (suspend/resume as initiated by PROPAGATION_REQUIRES_NEW
) is officially supported by IBM!
On WebLogic Server 9.0 or above, you typically would use the WebLogicJtaTransactionManager
instead of the stock JtaTransactionManager
class. This special WebLogic-specific subclass of the normal JtaTransactionManager
supports the full power of Spring’s transaction definitions in a WebLogic-managed transaction environment, beyond standard JTA semantics: Features include transaction names, per-transaction isolation levels, and proper resuming of transactions in all cases.
这篇关于spring学习10-Application server-specific integration(具体的事物配置 结合特定的应用服务器)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!