You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by co...@apache.org on 2007/10/25 22:00:00 UTC
[CONF] Apache Tuscany: RDB DAS C++ - ChangeSummaryProcessing (page
created)
RDB DAS C++ - ChangeSummaryProcessing (TUSCANY) created by Adriano Crestani
http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=69445
Content:
---------------------------------------------------------------------
h1. ChangeSummaryProcessing
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:
{panel}
DASImpl\* das = (DASImpl*) DASImpl::getFactory().createDAS(getConnection());
CommandPtr select = das->createCommand("Select * from CUSTOMER where ID = 1");
DataObjectPtr root = select->executeQuery();
DataObjectPtr customer = root->getDataObject("CUSTOMER\[1\]");
customer->setCString("LASTNAME", "Pavick");
das->applyChanges(root);
{panel}
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:
{noformat}
UPDATE CUSTOMER SET LASTNAME = 'Pavick' WHERE ID = 1
{noformat}
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.
---------------------------------------------------------------------
CONFLUENCE INFORMATION
This message is automatically generated by Confluence
Unsubscribe or edit your notifications preferences
http://cwiki.apache.org/confluence/users/viewnotifications.action
If you think it was sent incorrectly contact one of the administrators
http://cwiki.apache.org/confluence/administrators.action
If you want more information on Confluence, or have a bug to report see
http://www.atlassian.com/software/confluence
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org