user manual

208 BES Developers Guide
JDBC API Modifications
JDBC API Modifications
The standard Java Database Connectivity (JDBC) API is used by BES to
access databases that support JDBC through vendor provided drivers.
Requests for access to a database is centralized through the BES JDBC
Connection Pool. This section describes modifications the BES JDBC pool
makes to JDBC behavior for transactions.
The JDBC pool is a pseudo JDBC driver that allows a transactional application
to obtain a JDBC connection to a database. The JDBC pool associates JDBC
connections with the Transaction Manager's transactions, and delegates
connection requests to JDBC drivers that factory the JDBC connections. Once
a connection is obtained using the JDBC pool, the transaction is coordinated
automatically by the transaction service.
The JDBC pool and its associated resources provide complete transactional
access to the DBMS. The JDBC pool registers resources transparently with
the transaction coordinator. Because of limitations of the 1.x version of the
JDBC API, the JDBC pool can only provide one-phase commit. Version 2.0 of
the JDBC API supports full two-phase commit.
Modifications to the behavior of the JDBC API
To enable JDBC access for transactional applications written in Java, you use
the JDBC API. The JDBC API is fully documented at the following web site:
www.javasoft.com/products
However, the behavior of some JDBC methods is overridden by the partition's
transaction service when they are invoked within the context of a transaction
managed by the partition. The following methods are affected:
Java.sql.Connection.commit()
Java.sql.Connection.rollback()
Java.sql.Connection.close()
Java.sql.setAutoCommit(boolean)
The rest of this section explains the changes to the semantics of these
methods for partition-managed transactions.
Note If a thread is not associated with a transaction, all of these methods will use
the standard JDBC transaction semantics.
Overridden JDBC methods
Java.sql.Connection.commit()
As defined in the JDBC API, this method commits all work that was performed
on a JDBC connection since the previous commit() or rollback(), and releases
all database locks.