客户端,clientDataSet修改后,是否有delta这个东西?
只保存了修改过的记录,而不是全部记录。
DataSetProvider,与clientDataSet 的通讯是通过indy传输的。无状态。
考虑网络传输性能的提高,怎么样只提交delta这个包来更新数据。
最好给个完整的过程代码。急急!

解决方案 »

  1.   

    clientDataSet.ApplyUpdates就是只提交delta包更新的datasnap2009默认就是使用indy传输的
      

  2.   

    DataSetProvider1.ApplyUpdates中的
    clientDataSet与哪个DataSetProvider连接,是不知道的.
    直接赋值DataSetProvider1.ApplyUpdates(delta);好像不行
      

  3.   

    var Err: Integer;
    --------
    ClientDataSetM.Reconcile(
            DataSetProviderM.ApplyUpdates(ClientDataSetM.Delta,0,Err));
      

  4.   

    function ApplyUpdates(MaxErrors: Integer); Integer;
    ApplyUpdates 1. Generates a BeforeApplyUpdates event. (This event may not be public on some TCustomClientDataSet descendants.)
    2. Calls the provider to apply the updates in the Delta property and receives any records returned by the provider because they generated errors when it attempted to apply them to the database.
    3. Generates an AfterApplyUpdates event. (This event may not be public on some TCustomClientDataSet descendants.)
    4. Calls the client dataset抯 Reconcile method to reconcile any records that are returned in step 2.如果想分析delta,可以直接把这个delta赋值给一个ClientDataSet.Data,传到服务端去慢慢处理..
      

  5.   

    由于,clientDateSet 的DataSetProvider没有,所以不能直接使用ApplyUpdates方法
    但是可以提交delta,和表名即可
    一个Qry+DataSetProvider,将select * from 表名赋值给qry.sql.text;
    再使用ApplyUpdates即可