同步框架:如何指定多个表的同步顺序?

发布于 2024-08-20 13:34:30 字数 64 浏览 3 评论 0原文

有谁知道以特定顺序同步多个表的方法吗?具体来说,父表和子表中都有新创建的数据,并且要求父表插入发生在子表插入之前。

Does anynody know a way to sync multiple tables in a particular order. in detail, there are new created data in both parent and child tables and it requires the parent-insertion happens before the child does.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

神也荒唐 2024-08-27 13:34:30

每个表的处理顺序取决于将其 SyncTable 对象添加到同步代理的表集合中的顺序。

下表在订单表之前添加了客户表。

SyncGroup customerOrderSyncGroup = new SyncGroup("CustomerOrder");

SyncTable customerSyncTable = new SyncTable("Customer");
customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
customerSyncTable.SyncGroup = customerOrderSyncGroup;
this.Configuration.SyncTables.Add(customerSyncTable);

SyncTable orderSyncTable = new SyncTable("Order");
orderSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderSyncTable.SyncDirection = SyncDirection.DownloadOnly;
orderSyncTable.SyncGroup = customerOrderSyncGroup;
this.Configuration.SyncTables.Add(orderSyncTable);

更多信息位于此处

The order in which each table is processed depends on the order in which its SyncTable object was added to the collection of tables for the synchronization agent.

The following table adds the customer table before the order table.

SyncGroup customerOrderSyncGroup = new SyncGroup("CustomerOrder");

SyncTable customerSyncTable = new SyncTable("Customer");
customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
customerSyncTable.SyncGroup = customerOrderSyncGroup;
this.Configuration.SyncTables.Add(customerSyncTable);

SyncTable orderSyncTable = new SyncTable("Order");
orderSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderSyncTable.SyncDirection = SyncDirection.DownloadOnly;
orderSyncTable.SyncGroup = customerOrderSyncGroup;
this.Configuration.SyncTables.Add(orderSyncTable);

More information is here

手长情犹 2024-08-27 13:34:30

如果您有主详细信息记录,例如订单和订单详细信息,请仅将与其自己的同步组相关的表(为其他不相关的表创建其他同步组),然后在事务内同步该组。这可确保主记录和详细记录都同步或都不同步。

如果您需要更多有关如何执行此操作的信息,请大声喊叫。

If you have master detail records, such as order and orderdetail, then please JUST the tables that are related into their own sync group, (create other sync groups for other unreleated tables) then sync that group inside a transaction. This ensures that both master and detail records get synchd or neither do.

Shout if you need more on how to do this..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文