Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

DataObject customer = (DataObject) root.get("CUSTOMER\[1\]");
customer.set("LASTNAME", "Pavick");

//Some period of time passes in which "CUSTOMER\[1\]" could be modified by another process or application

das.applyChanges(root);

Panel

Command select = das.createCommand("Select * from CUSTOMER where LASTNAME = 'Williams'");
DataObject root = select.executeQuery();

Wiki Markup
Wiki Markup

...

If OCC is enabled then as part of "applyChanges" processing the DAS will ensure that the table row representing "CUSTOMER\[1\]" has not been changed since it was read. This is possible because a feature of the original SDO graph is to "remember" its original state along with any changes that have been made. The DAS has access to this original state and uses it to create an "overqualified" update statement. When the DAS executes this update statement against the database, it will fail if the underlying data has been modified (a collision has occurred) and, if so, an exception will be thrown and the transaction rolled back. If there is no collision then the update statement execution succeeds and the change is applied.