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:
  • Any modifications or updates to the value of collision detection column is not supported.
  • If you choose to use collision detection column, the use of the collision detection column will take precedence over the alternative optimistic concurrency control scheme of including attributes in a predicate for optimistic access intents. In addition, all the optimistic predicate settings will be ignored for optimistic access intent.
  • Adding a column for collision detection is available for top-down and meet-in-the middle mapping. Bottom-up mapping1 is not supported.
  • Column names beginning with "DISCRIM" or "OCC_" are reserved names for the EJB Mapping tools.
    • Do not specify a CMP field name to begin with either the following strings: "DISCRIM" or "OCC_".
    • Do not associate a CMP with another CMP whose name begin with either the following strings: "DISCRIM" and "OCC_".

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

1 Bottom-up mapping is not available in WebSphere® Application Server Toolkit or Rational® Web Developer.
Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.