Spring's transaction abstraction generally is application server
agnostic. Additionally, Spring's
which can optionally perform a JNDI lookup for the JTA
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.
Please see the
JtaTransactionManager Javadocs for details.
JtaTransactionManager is the standard
choice when running on J2EE application servers, known to work on all common
servers. Its advanced functionality such as transaction suspension is known to
work 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 and BEA WebLogic and also for Oracle OC4J.
We'll discuss these adapters in the following sections.
For standard scenarios, including WebLogic, WebSphere and OC4J,
consider using the convenient
configuration element. This will automatically detect the underlying
server and choose 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; they will rather be chosen
automatically, with the standard
as default fallback.
On WebSphere 6.0 and above, the recommended Spring JTA transaction
manager to use is
This special adapter leverages IBM's
API which is available in WebSphere Application Server 126.96.36.199 or above
and 188.8.131.52 or above. With this adapter, Spring-driven transaction suspension
(suspend/resume as initiated by
is officially supported by IBM!
In a WebSphere 5.1 environment, you may wish to use
class. This is a factory bean which retrieves the JTA
TransactionManager in a WebSphere environment, which
is done via WebSphere's
static access methods.
Once the JTA
TransactionManager instance has
been obtained via this factory bean, Spring's
JtaTransactionManager may be configured with a
reference to it, for enhanced transaction semantics over the use of only
Please see the Javadocs for full details.
usage is known to work on WAS 5.1 and 6.0 but is not officially supported
by IBM. Prefer
when running on WAS 6.0 or higher (see above).
On WebLogic 8.1 or above, you will generally prefer to use
of the stock
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 above:
OC4JJtaTransactionManager. This is analogous to
WebLogicJtaTransactionManager class discussed
in the previous section, providing similar value-adds on OC4J:
transaction names and per-transaction isolation levels.
Note that the full JTA functionality, including transaction suspension,
works fine with Spring's
OC4J as well. The special
adapter simply provides value-adds beyond standard JTA.