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 JTA TransactionManager
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,
Geronimo, and Oracle OC4J -- without any special configuration required.
However, for fully supported transaction suspension and further advanced
integration, Spring ships special adapters for IBM WebSphere, BEA WebLogic
Server, and Oracle OC4J. These adapters iare discussed in the following
sections.
For standard scenarios, including WebLogic Server,
WebSphere and OC4J, 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's UOWManager
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 ships a special adapter class for OC4J 10.1.3 or later
called OC4JJtaTransactionManager
. This class is
analogous to the WebLogicJtaTransactionManager
class discussed in the previous section, providing similar value-adds on
OC4J: transaction names and per-transaction isolation levels.
The full JTA functionality, including transaction suspension,
works fine with Spring's JtaTransactionManager
on
OC4J as well. The special
OC4JJtaTransactionManager
adapter simply provides
value-adds beyond standard JTA.