For distributed platforms For i5/OS platforms
WebSphere WebSphere Application Server Network Deployment, Version 6.1.x Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

Sharing connections to benefit from one-phase commit optimization

When to benefit from, and how to achieve one-phase commit optimization when using a data store.

About this task
Messaging engines store persistent data in a database, using a JDBC data source to interact with that database. Some JMS applications also store persistent data in a database, for example if the application uses entity enterprise beans. Typically, such applications use two-phase commit transactions to coordinate updates to the JMS and JDBC resources involved.

You can configure your application to share the JDBC connection used by a messaging engine, which enables you to use one-phase commit transactions and improve the performance of your application. You can benefit from the one-phase commit optimization in the following circumstances:

Restriction: You cannot benefit from the one-phase commit optimization in the following circumstances:
  • If your application uses a reliability attribute other than assured persistent for its JMS messages.
  • If your application uses BMP entity beans, or JDBC clients.
  • If your application uses DB2 High Availability Disaster Recovery (HADR).

Before you configure your system, ensure that you consider all of the components of your J2EE application that might be affected by one-phase commits. To optimize for one-phase commit transactions, perform the following steps:

Procedure

  1. Select the assured persistent reliability attribute for your JMS messages.
  2. Deploy all CMP enterprise beans involved in one-phase commit transactions with res-auth set to Container.
  3. Deploy all CMP enterprise beans involved in one-phase commit transactions with an AccessIntent that maps to a transaction isolation level of JDBC Read Committed. You can choose any of the following values for AccessIntent:
    • WSOptimisticUpdate
    • WSOptimisticRead
    • WSPessimisticUpdate-NoCollisions
    Oracle tip: All values for AccessIntent, except WSPessimisticUpdateExclusive, map to the JDBC Read Committed transaction isolation level.
    DB2 tip: You can use any value for AccessIntent, because WebSphere exploits the DB2 dynamic transaction isolation level support.
  4. Ensure that you use the same authentication alias for both your CMP enterprise beans and the messaging engine data store.
  5. When you configure your JDBC data source, ensure that you select the option: Use data source for CMP beans.
  6. Set the value of the JDBC data source custom property jmsOnePhaseOptimization to true.
  7. Set the value of the JMS connection factory property shareDataSourceWithCMP to true.
  8. When you create your JDBC provider and set the Select the implementation type field, ensure that you select Connection pool data source (and not XA data source).
  9. Set the value of the JMS activation specification property shareDataSourceWithCMP to true.
    Tip: Use the J2C activation specification panels or commands to set the shareDataSourceWithCMP property. For this release, you cannot set this property with the JMS activation specification panels or commands.
Related tasks
Enabling CMP entity beans and messaging engine data stores to share database connections

Task topic

Terms of use | Feedback


Timestamp icon Last updated: 26 February 2009
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.pmc.nd.multiplatform.doc/tasks/tjm0280_.html

Copyright IBM Corporation 2004, 2009. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)