This task describes how to add a column for collision detection
when generating a top-down mapping.
Prerequisite tasks- Enable the J2EE and Database Capabilities. You can complete
this as follows:
- In the workbench preferences page (Windows > Preferences)
expand the folder Workbench , select Capabilites.
- Under the Capabilities list, select the check
boxes: J2EE Developer. Click OK.
- Create a version 1.3 or 1.4 enterprise application project with a target
server of WebSphere® Application
Server v6.0.
- Create a version 2.x EJB project in the enterprise application project
you just created.
- Create or import a 2.x CMP beans in the EJB project that correspond to
the enterprise application project you just created.
- Set up the optimistic access intent to wsOptimisticUpdate or wsOptimisticRead.
Steps for this taskTo generate a collision detection column
for top-down EJB 2.x CMP entity bean, complete the following:
- 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.
Post task
Before using the collision detection column,
you must complete the following:
- Create your own database trigger to support the use of the collision detection
column.
ResultsAdding 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 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.
