WebSphere Application Server Network Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Monitoring optimistic concurrency control collisions

Why and when to perform this task

To diagnose transaction problems that are caused by update collisions, implement an optimistic concurrency control (OCC) strategy for the JDBC DMS.

An update collision occurs when client data that populates a data graph is changed in the database before the data graph can submit the modifications of the client. If you configure the JDBC DMS for OCC, the DMS issues an OCC-specific exception when such a data collision happens. The OCC exception contains collision details such as the original row values, current row values, and the attempted row values. The client application uses these values to determine how to recover from the collision. For example, the application can reread the data and restart the transaction.

Be aware, however, that when one exception occurs, there is no way of knowing whether more exceptions exist deeper in the data graph schema and therefore are not displayed.

To activate OCC for the data mediator service, you must incorporate OCC columns into your database tables.

Add an OCC Integer column to a given table, and specify that this column is to be used for OCC in the metadata. The defined OCC collision column is reserved for the exclusive use of the mediator. If there is no OCC column defined for a table, the DMS does not monitor and notify you of update collisions. The following generic code segments create this setup.

Steps for this task

  1. Create the OCC column
    Column collisionColumn = table.addIntegerColumn("OCC_COUNT");
    
  2. Ensure that it does not allow null values
     collisionColumn.setNullable(false);
    
  3. Designate the column as the table collision column
     table.setCollisionColumn(collisionColumn);

    For a full-fledged code example that forces a collision to demonstrate the OCC exception, see the topic Example: OCC data collisions and JDBC mediator.




Related reference
JDBC mediator exceptions
Example: OCC data collisions and JDBC mediator

Task topic    

Terms of Use | Feedback

Last updated: Dec 11, 2005 4:07:15 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tdat_sdoocc.html

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