VERIFY_READ_COLUMNS VERIFY_MODIFIED_COLUMNS VERIFY_SELECTED_COLUMNS VERIFY_NONE

6-28 Oracle Fusion Middleware Programming JDBC for Oracle WebLogic Server e_salary integer, e_name varchar25 ; ■ A single row in the table: e_id = 1, e_salary = 10000, and e_name = John Smith In the example for each of the optimistic concurrency policies listed below, the rowset will read this row from the employees table and set John Smiths salary to 20000. The example will then show how the optimistic concurrency policy affects the SQL code issued by the rowset.

6.17.1 VERIFY_READ_COLUMNS

The default rowset optimistic concurrency control policy is VERIFY_READ_ COLUMNS. When the rowset issues an UPDATE or DELETE, it includes all columns that were read from the database in the WHERE clause. This verifies that the value in all columns that were initially read into the rowset have not changed. In our example update, the rowset issues: UPDATE employees SET e_salary = 20000 WHERE e_id = 1 AND e_salary=10000 AND e_name = John Smith;

6.17.2 VERIFY_MODIFIED_COLUMNS

The VERIFY_MODIFIED_COLUMNS policy only includes the primary key columns and the updated columns in the WHERE clause. It is useful if your application only cares if its updated columns are consistent. It does allow your update to commit if columns that have not been updated have changed since the data has been read. In our example update, the rowset issues: UPDATE employees SET e_salary = 20000 WHERE e_id = 1 AND e_salary=10000 The e_id column is included since it is a primary key column. The e_salary column is a modified column so it is included as well. The e_name column was only read so it is not verified.

6.17.3 VERIFY_SELECTED_COLUMNS

The VERIFY_SELECTED_COLUMNS includes the primary key columns and columns you specify in the WHERE clause. WLRowSetMetaData metaData = WLRowSetMetaData rowSet.getMetaData; metaData.setOptimisticPolicyWLRowSetMetaData.VERIFY_SELECTED_COLUMNS; Only verify the e_salary column metaData.setVerifySelectedColumne_salary, true; metaData.acceptChanges; In our example update, the rowset issues: UPDATE employees SET e_salary = 20000 WHERE e_id = 1 AND e_salary=10000 The e_id column is included since it is a primary key column. The e_salary column is a selected column so it is included as well. Using RowSets with WebLogic Server 6-29

6.17.4 VERIFY_NONE

The VERIFY_NONE policy only includes the primary key columns in the WHERE clause. It does not provide any additional verification on the database data. In our example update, the rowset issues: UPDATE employees SET e_salary = 20000 WHERE e_id = 1

6.17.5 VERIFY_AUTO_VERSION_COLUMNS