Using JDBC and SQLJ in enterprise beans: special considerations

Start of changeFrom CICS® enterprise beans, you can use the JDBC 1.2 driver, the JDBC 2.0 driver, or the DB2 Universal JDBC Driver supplied by DB2®. As the JDBC 2.0 driver and the DB2 Universal JDBC Driver are downward compatible, enterprise beans that were written using the JDBC 1.2 API can run using the newer drivers, and can benefit from performance improvements made in those drivers.End of change

Open transaction environment (OTE) exploitation also benefits the performance of enterprise beans that make DB2 requests. (See Enabling CICS DB2 applications to exploit the open transaction environment (OTE) through threadsafe programming for an full explanation of how application programs can exploit the open transaction environment.) With DB2 Version 5 and earlier, CICS did not exploit the open transaction environment, and four TCB switches were needed for each DB2 request made by an enterprise bean:

  1. A switch from the enterprise bean's TCB to the CICS QR TCB, where the CICS DB2 task-related user exit was invoked.
  2. A switch to one of the TCBs managed by the task-related user exit, where the DB2 subtask was carried out.
  3. A switch to return to the task-related user exit on the CICS QR TCB.
  4. A final switch to return to the enterprise bean on its TCB.

When CICS is connected to DB2 Version 6 or later, it exploits the open transaction environment, and only two TCB switches are needed for each DB2 request:

  1. A switch from the enterprise bean's TCB to the L8 TCB, where the task-related user exit is invoked, and on which the DB2 requests are made.
  2. A switch back to the enterprise bean's TCB.

When using JDBC and SQLJ in enterprise beans, bear in mind the following considerations:

Related tasks
Programming with JDBC and SQLJ in the CICS DB2 environment
Acquiring a connection to a database
Acquiring a connection using the JDBC DriverManager interface
Acquiring a connection using the DataSource interface
Committing a unit of work
CICS abends during JDBC or SQLJ requests
[[ Contents Previous Page | Next Page Index ]]