Java Reference
In-Depth Information
10.2.3
The <transactionManager> element
As the name implies, the transaction manager manages transactions (which were
covered in detail in chapter 7) for your DAO classes. The <transactionManager>
element provides the name of a DaoTransactionManager implementation. The
i BATIS DAO framework comes with seven different transaction managers that can
work with different data access tools, as shown in table 10.1.
Table 10.1
Transaction managers available with the iBATIS DAO framework
Type alias
Transaction manager/properties
Comments
EXTERNAL
A “do-nothing” transaction that allows you to
manage your own transactions outside of
the iBATIS DAO framework.
ExternalDaoTransactionManager
HIBERNATE
HibernateDaoTransactionManager Delegates to the Hibernate transaction man-
agement functionality.
Uses JDBC to provide connection pooling
services via the DataSource API. Three
DataSource implementations are sup-
ported: SIMPLE, DBCP, and JNDI.
SIMPLE is an implementation of the iBATIS
SimpleDataSource , which is a stand-alone
implementation ideal for minimal overhead
and dependencies.
DBCP is an implementation that uses the
Jakarta DBCP DataSource .
Finally, JNDI is an implementation that
retrieves a DataSource reference from a
JNDI directory. This is the most common and
flexible configuration, as it allows you to cen-
trally configure your application via your
application server.
JDBC
JdbcDaoTransactionManager
* DataSource
* JDBC.Driver
* JDBC.ConnectionURL
* JDBC.Username
* JDBC.Password
* JDBC.DefaultAutoCommit
JTA
Manages transactions using the Java Trans-
action Architecture (JTA) API.
Requires that the DataSource implementa-
tion be retrieved via JNDI and that User-
Transaction instances also be accessible
via JNDI.
JtaDaoTransactionManager
* DBJndiContext
* UserTransaction
OJB
Delegates to the OJB transaction manage-
ment functionality.
OjbBrokerTransactionManager
SQLMAP
Delegates to the SQL map transaction man-
agement functionality.
SqlMapDaoTransactionManager
TOPLINK
Delegates to the TOPLINK transaction man-
agement functionality.
ToplinkDaoTransactionManager
Search WWH ::




Custom Search