I am trying to see if the below is a potential problem or a rare case. Please give your comments.
Let us take an example - customer doing bulk purchase. When DAS does query to Customer+Order it gets back - Customer1->Order1...Order50 (DAS starts ChangeSummary logging after query is transformed into DataGraph) At first time, Customer deletes Order1...Order10 He then modifies Order11....Order20 He then creates Order1...Order10 (say there is no auto-gen keys etc. and Customer just preserves the deleted Orders' IDs in the new ones.) Customer finally wants to push the changes to DB thru SDO+DAS DAS has a DataGraph which says - 10 delete, 10 updates and 10 inserts As DAS has no way to know in which sequence to fire DB statements as per current code DAS buckets all deletes first, then all inserts and then all updates - form required DB statements and all goes well. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- at another time, Customer creates 10 new orders - Order51...Order60 updates same - Order51...Order60 and then due to some reason (say no funds :)), deletes some from those Order51...Order55 Customer finally wants to push the changes to DB thru SDO+DAS DAS again has a DataGraph which says - 5 deletes, 10 updates and 10 inserts. DAS has no way to know that now inserts should happen first, then updates and then deletes as there is no time tracked. So DAS follows the previous logic - 1> delete Order51...Order55, 2>insert Order51...Order60, 3> Update Order51...Order60 So now, as 1> is trying to operate on data which is not there in DB yet, there is SQL Exception and further operation will not complete --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Regards, Amita On 10/2/07, kelvin goodson <[EMAIL PROTECTED]> wrote: > > Comments inline ... > Kelvin. > > On 02/10/2007, Amita Vadhavkar <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Question in SDO - > > ChangeSummary changeSummary = root.getDataGraph().getChangeSummary(); > > List changedDOs = commonj.sdo.ChangeSummary.getChangedDataObjects(); > > > > is changedDOs an ordered list with order based on time of the change ( > i.e. > > if a user does a particular sequence of create, delete etc. > > is the sequence preserved in the changedDOs?) > > A change summary describes the net effect of changes on the data > objects in the scope of the change summary since the point that > logging began. It doesn't reveal a full temporally sequenced change > history. > > > > > Question in DAS - > > when das.applyChanges(root) happens with multiple changes, in > > Changes.execute() - DAS uses buckets of 1) insert, 2)update, 3) delete > to > > fire the SQL statements in > > that order. Thus DAS does not attempt to preserve the order from > changedDOs. > > As a result, even if a user has done delete(customer.id=1) and then > create( > > customer.id=1), DAS > > attempts INSERT first and then DELETE and give SQL Integrity exception. > > > > If SDO change summary is preserving the order of changes, will it be > better > > to propagate the same order in Changes.execute()? > > > > {Please refer to JIRA-1815 for some history.} > > > > Regards, > > Ammita > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >