Adding a column for collision detection

For EJB 2.x CMP entity beans, you can add a column in your relational database table for collision detection. This collision detection column is an additional database column reserved to determine if a record has been updated. To manage the collision detection column, you will need to provide your own database trigger implementation.

The following are the benefits of choosing to add a column for collision detection over the alternative optimistic concurrency control scheme of including attributes in a predicate for optimistic access intents:

The following are restrictions of using the collision detection column:

Select one of the following approaches to add a column for collision detection:

Adding a column for collision detection when generating a top-down mapping
This task describes how to add a column for collision detection when generating a top-down mapping.

Adding a column for collision detection when the CMP bean exists
This task describes how to add a column for collision detection using the Mapping editor.

 

Parent topic

Specifying optimistic concurrency control scheme for EJB 2.x CMP entity beans

1 Bottom-up mapping is not