J
Jeff Ledbetter
Guest
Is it because you are passing TRUE for the copy-all mode to MERGE-CHANGES? “When TRUE, the AVM merges all after-image table rows whether or not they contain changes. In this case, the temp-table in the original ProDataSet object must have a unique primary index that the AVM can use to find each corresponding row from the after-image table (since unchanged rows do not have a corresponding row in the before-image table). When a corresponding row is not found in the original ProDataSet object, the AVM creates a new row using the row from the after-image table. When FALSE, the AVM merges only after-image table rows that contain changes. The default value is FALSE.” Jeff Ledbetter www.roundtable-software.com email: jeff.ledbetter@roundtable-software.com skype: jeff.ledbetter From: Mike Fechner [mailto:bounce-mikefechner@community.progress.com] Sent: Friday, February 13, 2015 9:05 AM To: TU.OE.Development@community.progress.com Subject: [Technical Users - OE Development] ProDataset MERGE-CHANGES copy-all-mode unexpected behaviour? ProDataset MERGE-CHANGES copy-all-mode unexpected behaviour? Thread created by Mike Fechner Hi all, is this really expected behaviour? Tested on 11.5, 11.3 and 10.2B I have a ProDataset with two tables, let's call them eCustomer and eSalesRep. eCustomer has a BEFORE-TABLE, eSalesRep does not. I create two customer records and two salesrep records, turn on TRACKING-CHANGES for eCustomer and modify one record. Then I get the changes dataset ... hChanges:GET-CHANGES (DATASET dsCustomer:HANDLE, TRUE) . and as expected the hChanges dataset contains a single customer record and no salesrep. Then I use the MERGE-CHANGES method (directly without calling into any data access layer to process changes): hChanges:MERGE-CHANGES (DATASET dsCustomer:HANDLE, TRUE) . My expectation is, that MERGE-CHANGES copies data from the hChanges dataset to the dataset dsCustomer. In a real scenario this would update the client side eCustomer table with data updated during processing the changes on the AppServer. The copy-all-mode (the logical parameter) should control - to my understanding - that unmodified records (from tables with or without a BEFORE TABLE) from the hChanges dataset are merged into dsCustomer as well. But why the heck, are the two unmodified salesrep records getting copied form dsCustomer to hChanges dataset???? And if - for what ever reason - that would be expected - why is the unmodified customer NOT copied in that direction as well???? I have a message before and after the MERGE-CHANGES: MESSAGE "changes dataset" SKIP "Customer" hChanges::eCustomer:TABLE-HANDLE:HAS-RECORDS CountRecords(hChanges::eCustomer:HANDLE) SKIP "SalesRep" hChanges::eSalesRep:TABLE-HANDLE:HAS-RECORDS CountRecords(hChanges::eSalesRep:HANDLE) SKIP VIEW-AS ALERT-BOX. Message before MERGE-CHANGES changes dataset Customer yes 1 SalesRep no 0 Message after MERGE-CHANGES changes dataset Customer yes 1 SalesRep yes 2 Source code attached. Attachments: merge-changes-issue.p Stop receiving emails on this subject. Flag this post as spam/abuse.
Continue reading...
Continue reading...