For attributes of EJB 2.x CMP entity beans, the Properties view of the Mapping editor includes a property for optimistic predicate.
If you have an optimistic access intent setup (wsOptimisticUpdate or wsOptimisticRead), you need to specify the attributes that you want to be included in the predicate. If an attribute is set to true, the attribute will be included in the WHERE predicate in the bean's UPDATE SQL statement. By default, the mapping editor sets each attribute to false, except for attributes that are primitive types, which are set to true.
In versions of WebSphere® Studio Application Developer earlier than V5.0, adding attributes of an EJB 1.1 CMP entity bean to an optimistic predicate was not supported. However, if you use the workbench to deploy an EJB application that you developed using a version earlier than V5.0 and does not include a list of attributes for an optimistic predicate, all of the available predicates are used. EJB 2.x CMP entity beans are treated differently. If no attributes are selected as predicates, then none are added to the overqualified update.
UPDATE SET NAME = ? WHERE ID = ? AND NAME IS NOT DISTINCT FROM ?This new IS NOT DISTINCT FROM syntax removes the restriction against null predicates on DB2 Universal Database for z/OS and OS/390, V8 and higher for both JDBC and SQLJ.
For all other backends database vendors, beans with nullable predicate columns can be used by enabling partial update for that bean (selecting the UPDATE_ONLY value for the partial operation). Partial update is supported for JDBC only. For SQLJ, the restriction against null predicates remains. For more details on using partial operation as a persistence option, refer to the following two topics: Partial operation for container managed persistence and Adding bean-level access intent for entity beans 2.x.