Develop > Business logic layer > Work with the data service layer


Enable optimistic concurrency control for custom tables

Most WebSphere Commerce tables use optimistic locking for database performance reasons. A similar functionality is provided for the data service layer, called optimistic concurrency control. Optimistic concurrency control can slightly decrease performance but allows for much greater concurrency during heavy database load, because it allows for a reduction in the transaction isolation level, reducing locking.

Not implementing optimistic locking on custom tables can result in data corruption when data collision occurs.

To enable optimistic concurrency control for custom tables:


Procedure

  1. Add an OPTCOUNTER column (of type SMALLINT or INTEGER) to the table.

  2. Follow the steps in Accept object-relational metadata and Physical Service Data Objects to reflect schema changes using the Data Service Layer Wizard, specifying the custom table. The metadata and physical SDO classes are generated with the inclusion of the OPTCOUNTER column, and optimistic concurrency control is enabled.


Related concepts

Optimistic concurrency control

Data service layer


+

Search Tips   |   Advanced Search