Differences between revisions 1 and 2
Revision 1 as of 2006-10-12 03:01:47
Size: 1552
Editor: 68-69-138-189
Revision 2 as of 2009-09-20 22:47:26
Size: 1552
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

SDO provides an important feature called the ChangeSummary. Using this feature, a graph of related DataObjects can track changes made to iteself. These changes include additions to the graph, deletions, DataObject property (attribute) changes and even changes to object relationships.

The RDB DAS leverages the SDO ChangeSummary to drive graph chages to a database. Here is a simple example:

   DAS das = DAS.FACTORY.createDAS(getConnection());
   Command select = das.createCommand("Select * from CUSTOMER where ID = 1");
   DataObject root = select.executeQuery();

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

The first half of this example creates a new read command and executes it. The result is a graph of DataObjects (in this case just one) represented by the containing "root".

The second half of the example makes modification to a single object in the graph and then calls the applyChanges() method. As part of the applyChanges processing, the das will scan the SDO ChangeSummary and notice the modified DataObject. It will then generate the UPDATE statement required to reflect the change to the database:


Notice that only a single column is updated rahther than all columns. This is because the SDO ChangeSummary has enough fidelity to track changes on a property-by-property bases and the das has the ability to generate partial updates.

ChangeSummaryProcessing (last edited 2009-09-20 22:47:26 by localhost)