如何禁用SyncAdapter DeleteCommand? [英] How to disable SyncAdapter DeleteCommand?

查看:83
本文介绍了如何禁用SyncAdapter DeleteCommand?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道如何阻止DeleteCommand删除服务器行!我有几个客户端SyncTables是双向的,只上传,我想确保服务器数据受到保护(当客户端上的行过滤器更改时,我不希望服务器删除现在的行范围)。我的删除命令当前是默认的(自动生成的代码):

DELETE FROM SyncTableName WHERE PK_Field = [@PK_Field] AND(@sync_force_write = 1 OR([TimeStampUpdated]< = @sync_last_received_anchor))
SET @sync_row_count = @@ rowcount;

是否可以更改它什么都不做(即不删除任何服务器行),我该怎么做?目前,当客户端上的过滤器发生变化时,我的服务器数据被删除存在问题。

任何帮助表示赞赏

Jon

Hi, I'm just wondering how to stop the DeleteCommand from deleting server rows! I have a few client SyncTables that are bi-directional and upload only and I want to ensure that server data is protected (when the row filter is changed on the client, I do not want the server to delete the rows that are now out of scope). My delete command is currently the default (auto-generated code):

DELETE FROM SyncTableName WHERE PK_Field = [@PK_Field] AND (@sync_force_write = 1 OR ([TimeStampUpdated] <= @sync_last_received_anchor))
SET @sync_row_count = @@rowcount;

Is it possible to change it do nothing (i.e. not delete any server rows) and how can I do this? At the moment, I have a problem with server data being deleted when the filter changes on the client.

Any help appreciated

Jon

推荐答案

我以为记录被删除了,实际上服务器上传后没有处理过记录,也从未处理过。我重新启动了同步组件托管的IIS应用程序池,并开始再次处理记录。但是,从客户端的角度来看,记录已成功同步,即使记录从未到达数据库表,因此旧记录仍在设备上,因为客户端上的同步发送/接收锚点是在"成功"同步之后设置的。没有错误,或任何表明任何问题的东西。简单地说,即使同一个同步组中的其他同步表,也从未在服务器上处理过UploadOnly同步表。真奇怪的问题。
I thought records were being deleted, in fact the records were not being processed by the server once they were uploaded and were never processed to start with. I restarted the IIS application pool where the sync component is hosted and records started being processed again. However, from the client point of view records were sync'd successfully even though the records never reached the datbase table so old records are still on the device because the sync sent/received anchor on the client was set after the 'successful' sync. No errors, or anything to indicate any problems. Simply, the UploadOnly sync table was never processed on the server even though other sync tables in the same sync group were. Really strange problem.


这篇关于如何禁用SyncAdapter DeleteCommand?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆