none
WebSharingAppDemo-CEProviderEndToEnd RRS feed

  • Question

  • Hi,

    I'm experiencing an error with the WebSharingAppDemo-CEProviderEndToEnd sample.

    The scenario is to execute a sync using batch mode (I create more records on the order table and set batch size to 1 kb).

    If I create the peer database and create a new peer1CE peer db (dbpeerCE1). I execute the sync and everything is ok.

    Than I create a new db peer (dbpeerCE2) and now I try to execute the sync using dbpeerCE2 as soruce and dbpeerCE1 or server as destination. When the sync tries to execute the download (from dbpeerCE1 to dbpeerCE2) the SyncOrchestratro returns the error (serialization of a zero file sized batch). I've cheked and the battch file created inside the proxied provider is of zero size.

    Thanks for any help.

    Piero

     

    Sunday, May 23, 2010 11:17 AM

Answers

  • Hi,

    It is a bug in the sample. Please make below changes to workaround it before we release the updated sample.

    In file RelationalProviderProxy.cs, Change below line in method GetChangeBatch(...)

    From

                    FileStream localFileStream = new FileStream(localFileName, FileMode.Create, FileAccess.Write);
                    if (!localFileInfo.Exists)
                    {
                        byte[] remoteFileContents = this.proxy.DownloadBatchFile(context.BatchFileName);
                        using (localFileStream)
                        {
                            localFileStream.Write(remoteFileContents, 0, remoteFileContents.Length);
                        }
                    }

    To

                    if (!localFileInfo.Exists)
                    {
                        byte[] remoteFileContents = this.proxy.DownloadBatchFile(context.BatchFileName);
                        using (FileStream localFileStream = new FileStream(localFileName, FileMode.Create, FileAccess.Write))
                        {
                            localFileStream.Write(remoteFileContents, 0, remoteFileContents.Length);
                        }
                    }

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Tuesday, May 25, 2010 12:40 AM
    Moderator