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.
Before you begin
- Create a version 1.3 or 1.4 enterprise application project with a target server of WebSphere® Application Server v6.x.
- Create a version 2.x EJB project in the enterprise application project you created.
- Create or import a 2.x CMP beans in the EJB project that correspond to the enterprise application project you created.
- Set up the optimistic access intent to wsOptimisticUpdate or wsOptimisticRead.
About this task
To generate a collision detection column for top-down EJB 2.x CMP entity bean, complete the following:
Procedure
- Refer to the generating a top-down mapping task.
- In the EJB to RDB Mapping wizard, select the optional check box Add a column for collision detection.
Results
Post task
Before using the collision detection
column, you must complete the following:
Results- Create your own database trigger to support the use of the collision detection column.
Adding a column for collision detection results in the following events:
- The collision detection column is displayed in the Tables pane of the Mapping editor.
- The default data type of the collision detection column is BIG INTEGER.
- The naming convention of the collision detection column has the following format: OCC_beanName
- The top-down mapping generates an extra relational column. By default this column is not mapped as illustrated there is no mapping arrow icon.
- If you choose to use collision detection column, the use of the collision detection column takes 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 are ignored for optimistic access intent.