Note that there are some explanatory texts on larger screens.

plurals
  1. POMicrosoft Sync Framework 2.0 : is it possible to update the column value within the same sync transaction (Client Upload Server Update) scenario?
    primarykey
    data
    text
    <p>Let say, I have a table with 2 columns (OrderId and OrderDate). In the original design, OrderId is the surrogate (which is still somewhat meaningful to the end user since they still like to refer to OrderNumber 12345) PK with IDENTITY integer. Since we start to adopt SyncFx and to support offline client creation scenario, we decided to add a new column unique identifier (GUID) as the new PK. </p> <p>in my old <strong>working</strong> V1.0 implementation, the OrderId will be assigned as negative value (-1, -2 and so on) for the offline created records. when the sync happens, the OrderId will be reassigned with the 'next' number ( the server will perform the max() + 1 on the OrderId column in the table). the logic is implemented as a Stored procedure and it will be called during the insert trigger.</p> <pre><code>Update INSERTED set OrderId = b.NextNumber FROM INSERTED a, ( SELECT SyncGUID, ROW_NUMBER() OVER (ORDER BY SyncGUID) + (SELECT MAX(OrderId) MaxID FROM Order) as NextNumber --select * FROm Order where OrderId &lt;= 0 ) b where a.SyncGUID = b.SyncGUID </code></pre> <p>However, in V2.0, after the syc, the record is created in the server side and the OrderId did being updated (from -1 to 'next' number); however, that update change didn’t get download to the client. I was wondering </p> <ol> <li>I looking into the logic in the _selectchanges() SProc. i seems like i might need to manually manipulate the [local_update_peer_timestamp] in order for the enumeration to pick it up ?!</li> <li>Since the whole logic is running within the insert trigger (which the record is still not committed to the actual table), I am also wondering is it possible to have the enumeration being called again after the record is committed to the server table. (without calling another sync)</li> <li>Will the "INSTEAD OF INSERT" trigger offer any helps in this case?! I tried a few time but no workies with my limited knowledge. </li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload