none
Sync Framework 2.1-sqlsyncprovider -Batching RRS feed

  • Question

  • I am able to synchronize two remote databases using sync framework 2.1 over WCF(N-Tier) .

    To improve performance while transferring large data, I implemented Batching.

    But I am facing below error message:

    "An unexpected error occurred when applying batch file 1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch. See the inner exception for more details."

    This is happening only with last batch file (one which is smaller(kb) than MemoryDataCacheSize). When applying last batch file in the set of batch files the code is terminating at Applychnages() method with above error message.

    Below I am pasting xml format of wcf webservice log (inner exception):


    <InnerException>
    <ExceptionType>System.IO.FileNotFoundException, mscorlib, Version=4.0.0.0,     Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
    <Message>Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'.</Message>
    <StackTrace>
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode)
    at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String&amp; batchFileName)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
    </StackTrace>
    <ExceptionString>System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'.
    File name: 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode)
    at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String&amp; batchFileName)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)         
    </ExceptionString>
    </InnerException>

    Important:

    1) I have set %temp% folder as batching directory on both source and destination providers.

    2) Uploadbatchfile method is uploading all batch files to remote machine(wcf hosted on iis) successfully.

    3)Inner exception(pasted above) saying : Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'" .plz help me why inetsrv couldnot pick the file



    • Edited by saitrips Monday, October 15, 2012 5:54 PM
    Monday, October 15, 2012 5:11 PM

Answers

  • Hi JuneT,

    The batching started working.

    Rootcause:

    SQLSYNCPROVIDER instance on wcf becoming null.

    solution:

     [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    public class Service1 : RelationalWebSyncService, ISqlSyncContract

    I made instancecontextmode percall to single

    Thx u for your support and your suggestion,solutions in various threads.


    ess

    • Proposed as answer by JuneTModerator Monday, October 29, 2012 11:53 PM
    • Marked as answer by saitrips Tuesday, October 30, 2012 2:28 PM
    Monday, October 29, 2012 1:38 PM

All replies

  • can you post the code where you actually set the batching directory?
    Tuesday, October 16, 2012 2:12 AM
    Moderator
  • Hi JuneT,

    I implemented the code in the following example(Database Sync:SQL Server and SQL Express N-Tier with WCF)

    http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208/sourcecode?fileId=19017&pathId=1539916981

    in following class, I set the batchingdirectory:

    public class SynchronizationHelper

        {

            SqlSyncProvider provider;
            public SqlSyncProvider ConfigureSqlSyncProvider(string scopeName, string connectionString)
            {

                provider = new SqlSyncProvider();
                provider.ScopeName = scopeName;
                provider.Connection = new SqlConnection(connectionString);
                provider.BatchingDirectory="C:/Batching";

                return provider;
            }
        }


    ess


    • Edited by saitrips Tuesday, October 16, 2012 2:39 AM
    Tuesday, October 16, 2012 2:23 AM
  • can you confirm it's creating the batch files on that directory for both client and server? do you use the same code for both client and server to set the directory?

    Tuesday, October 16, 2012 2:35 AM
    Moderator
  • yes , it is creating the batch files on the directory specified. 

    Yes same code on client and server.


    ess

    Tuesday, October 16, 2012 2:52 AM
  • My current scenario:

    I made changes to my application  worth of 120kb.

    I set the batchsize to 100 in my code.

    client provider identify the changes and created 3 files in the batching directory.

    <guid>.batch  18kb

    <guid>.batch 101kb

    syncbatchheaderfile.sync 2kb

    both files(101kb,18kb) are uploaded to remote machine through uploadbatchfile() method available in proxy object

    Applychanges() method on proxy is called for 101kb bathc file and it is sucessfull.

    code terminating for 18kb batch file..

    not only this scenario, every time code failing for last and least size batch file when calling applychanges() method on proxy object


    ess

    Tuesday, October 16, 2012 3:27 AM
  • can you enable sync framework tracing both client and server side and post the trace where it fails.
    Tuesday, October 16, 2012 10:29 AM
    Moderator
  • 1) Server_log

    Method/event @code fails:

    Process action 'http://tempuri.org/IRelationalSyncContract/ApplyChanges'. 11 46ms 12:43:56 PM 12:43:56 PM

    Trace/Log : (XML FORMAT, only pasted exception tag)

    <Exception>
    <ExceptionType>Microsoft.Synchronization.Data.DbSyncException, Microsoft.Synchronization.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</ExceptionType>
    <Message>An unexpected error occurred when applying batch file 8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch. See the inner exception for more details.</Message>
    <StackTrace>
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
    at Microsoft.Synchronization.Data.RelationalSyncProvider.ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics)
    at thunderservice.RelationalWebSyncService.ApplyChanges(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeData) in C:\Users\sedupuganti\Desktop\new webservice friday solving issue on provider\thunderservice\thunderservice\RelationalWebSyncService.cs:line 135
    at SyncInvokeApplyChanges(Object , Object[] , Object[] )
    at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    </StackTrace>
    <ExceptionString>Microsoft.Synchronization.Data.DbSyncException: An unexpected error occurred when applying batch file 8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch. See the inner exception for more details. ---&gt; System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch'.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode)
       at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String&amp; batchFileName)
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
       --- End of inner exception stack trace ---
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
       at Microsoft.Synchronization.Data.RelationalSyncProvider.ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics)
       at thunderservice.RelationalWebSyncService.ApplyChanges(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeData) in C:\Users\sedupuganti\Desktop\new webservice friday solving issue on provider\thunderservice\thunderservice\RelationalWebSyncService.cs:line 135
       at SyncInvokeApplyChanges(Object , Object[] , Object[] )
       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</ExceptionString>
    <InnerException>
    <ExceptionType>System.IO.FileNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
    <Message>Could not find file 'c:\windows\system32\inetsrv\8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch'.</Message>
    <StackTrace>
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode)
    at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String&amp; batchFileName)
    at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
    </StackTrace>
    <ExceptionString>System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch'.
    File name: 'c:\windows\system32\inetsrv\8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch'
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode)
       at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String&amp; batchFileName)
       at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)</ExceptionString>
    </InnerException>
    </Exception>

    2)Client_Log

    Method/event @code fails:

    Process action 'http://tempuri.org/IRelationalSyncContract/ApplyChanges'. 8 812ms 12:47:43 PM 12:47:44 PM

    Trace/Log : (XML FORMAT, only pasted exception tag)

    <Exception>
    <ExceptionType>System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
    <Message>An unexpected error occurred when applying batch file 8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch. See the inner exception for more details.</Message>
    <StackTrace>
    at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
    at thunderclient.ServiceReference1.ISqlSyncContract.ApplyChanges(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeData)
    at thunderclient.RelationalProviderProxy.ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics)
    at Microsoft.Synchronization.KnowledgeProviderProxy.ProcessChangeBatch(CONFLICT_RESOLUTION_POLICY resolutionPolicy, ISyncChangeBatch pSourceChangeManager, Object pUnkDataRetriever, ISyncCallback pCallback, _SYNC_SESSION_STATISTICS&amp; pSyncSessionStatistics)
    at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS&amp; pSyncSessionStatistics)
    at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32&amp; changesApplied, Int32&amp; changesFailed)
    at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32&amp; changesApplied, Int32&amp; changesFailed)
    at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
    at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
    at thunderclient.Form1.button1_Click(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message&amp; m)
    at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
    at System.Windows.Forms.Button.WndProc(Message&amp; m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at thunderclient.Program.Main()
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    </StackTrace>
    <ExceptionString>System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: An unexpected error occurred when applying batch file 8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch. See the inner exception for more details. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
    Microsoft.Synchronization.Data.DbSyncException: An unexpected error occurred when applying batch file 8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch. See the inner exception for more details. ----&gt; System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\8df4e64e-f121-4b14-9a5f-bb77f8fac52f.batch'.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode)
       at Microsoft.Synchronization.Data.DbSync...).</ExceptionString>
    </Exception>

    Plz let men know if u need any additional info. Thx u for responding to my posts.


    ess

    Tuesday, October 16, 2012 4:56 PM
  • i was referring to a Sync Framework trace, see: http://msdn.microsoft.com/en-us/library/cc807160.aspx

    Wednesday, October 17, 2012 1:40 AM
    Moderator
  • i will post u the sync trace ASAP

    ess

    Wednesday, October 17, 2012 3:46 PM
  • Hi sir, I have a question regarding the batch size.

    I am working on getting u the sync trace.

    Before that could you please help me on setting the batchsize value.

    you cannot have a row that exceeds the 10mb batch size. (this line is copied from your blog sir (http://jtabadero.wordpress.com/2012/08/23/things-you-need-to-know-about-sql-data-sync-service/))

    I suspect this could be one of the reason for the sync failure.

    How to intiliaze batch size value dynamically based on max rowsize in changes provider identify? so that we can avoid the code termination bcz of row size exceeds batcsize


    ess

    Friday, October 19, 2012 2:22 PM
  • that blog post is the Azure Data Sync service.

    with regards to your question, you have to set the batch size before you initiate the sync. you cannot dynamically resize it while synchronizing.

    Monday, October 22, 2012 5:35 AM
    Moderator
  • Hi Sir

    sorry for the delay. Please find the traces of client and server where it fails:

    I used switch value(4: verbose). Please let me know if u need full log , I am ready to post it.

    server_trace:

    INFO   , w3wp, 24, 10/22/2012 14:18:35:266, RelationalSyncProvider.BatchedReception: Receiving Batched changes. Starting SyncBatchConsumer

    INFO   , w3wp, 24, 10/22/2012 14:18:35:266,    RelationalSyncProvider.BatchedReception: Enqueueing batch 0718abcd-3d1c-4109-bcb2-c8330b27d9df.batch to consumer.
    INFO   , w3wp, 24, 10/22/2012 14:18:35:266,    RelationalSyncProvider.BatchedReception: Received Last batch. Applying batched.
    INFO   , w3wp, 24, 10/22/2012 14:18:35:281,       SyncBatchConsumer: Applying 1 of 1 batches.
    ERROR  , w3wp, 24, 10/22/2012 14:18:35:281, Multi-transaction Rollback called.
    INFO   , w3wp, 24, 10/22/2012 14:18:35:281,       RowSorter: Deleting directory MATS_8f3d1bff-c61f-4ebd-824d-1c1feba76040

    client_trace:

    INFO   , thunderclient.vshost, 16, 10/22/2012 14:22:21:332,       RelationalSyncProvider.BatchedEnum: Adding non batched rows as the last batch. Last batch data size 8250 Bytes
    VERBOSE, thunderclient.vshost, 16, 10/22/2012 14:22:21:335,       SyncBatchProducer: Enqueuing Batch. Batch Details: 
    Version                   :3.1
    BatchId                   :0718abcd-3d1c-4109-bcb2-c8330b27d9df
    Batch Number              :2
    Is Last Batch             :True
    Data Cache Size           :8250
    Table Watermarks          :[MediaElements,205818776],[MediaElementViewMarks,205818779],[ObjectMasterTable,205818562],[Edits,205818494],[EditPlays,205818657],
    INFO   , thunderclient.vshost, 16, 10/22/2012 14:22:22:032,       SyncBatchProducer: Enqueuing Batch. Total Batches Enqueued: 2. Details: 
    Version                   :3.1
    BatchId                   :0718abcd-3d1c-4109-bcb2-c8330b27d9df
    Batch Number              :2
    Is Last Batch             :True
    Data Cache Size           :8250
    Table Watermarks          :[MediaElements,205818776],[MediaElementViewMarks,205818779],[ObjectMasterTable,205818562],[Edits,205818494],[EditPlays,205818657],
    INFO   , thunderclient.vshost, 16, 10/22/2012 14:22:22:086,       SyncBatchProducer: Signalling Queue availability event. Queue Count: 1
    INFO   , thunderclient.vshost, 16, 10/22/2012 14:22:22:090,       RelationalSyncProvider.BatchedEnum: Setting BgdEnumInProcess to false, BgdEnumCompleted to True and setting Cancellation event.
    INFO   , thunderclient.vshost, 8, 10/22/2012 14:22:22:090,       SyncBatchProducer: Queue availablility event fired
    VERBOSE, thunderclient.vshost, 8, 10/22/2012 14:22:22:102,       SyncBatchProducer: Resetting Queue availablility event.
    VERBOSE, thunderclient.vshost, 8, 10/22/2012 14:22:22:105,    Object of type System.String dequeued.
    VERBOSE, thunderclient.vshost, 8, 10/22/2012 14:22:22:108,    New batch available at C:\Users\SEDUPU~1\AppData\Local\Temp\sync_17460329d3d847cfa4fc3fcdda54912f2e6e9995c5654728acc7e9c99866eacf\0718abcd-3d1c-4109-bcb2-c8330b27d9df.batch
    INFO   , thunderclient.vshost, 8, 10/22/2012 14:22:22:111, Committing transaction
    VERBOSE, thunderclient.vshost, 8, 10/22/2012 14:22:22:115, Closing Connection

    Thank you,

    Sai


    ess


    • Edited by saitrips Monday, October 22, 2012 3:04 PM
    Monday, October 22, 2012 3:03 PM
  • your log says the batch file is at this directory :

    C:\Users\SEDUPU~1\AppData\Local\Temp\sync_17460329d3d847cfa4fc3fcdda54912f2e6e9995c5654728acc7e9c99866eacf\0718abcd-3d1c-4109-bcb2-c8330b27d9df.batch

    the server log indicates an error as well but there's no details around the error:

    ERROR  , w3wp, 24, 10/22/2012 14:18:35:281, Multi-transaction Rollback called.

    Tuesday, October 23, 2012 1:34 AM
    Moderator
  • yes, I implemented sync tracing perfectly and surprised that no detail error message is logged. I am running the code again to get you the right log.

    you have any clue reason for my  incomplete log


    ess


    • Edited by saitrips Tuesday, October 23, 2012 1:49 AM
    Tuesday, October 23, 2012 1:49 AM
  • Hi JuneT,

    The batching started working.

    Rootcause:

    SQLSYNCPROVIDER instance on wcf becoming null.

    solution:

     [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    public class Service1 : RelationalWebSyncService, ISqlSyncContract

    I made instancecontextmode percall to single

    Thx u for your support and your suggestion,solutions in various threads.


    ess

    • Proposed as answer by JuneTModerator Monday, October 29, 2012 11:53 PM
    • Marked as answer by saitrips Tuesday, October 30, 2012 2:28 PM
    Monday, October 29, 2012 1:38 PM
  • Hi JuneT,

    I have one last question.

    Are we free to use code snippets (classes) in following link in our projects or we need to purchase licence or permission from the author before using it in our projects.

    http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208/sourcecode?fileId=19017&pathId=1539916981

    Please let me know if u have any info on this.


    ess

    Tuesday, October 30, 2012 12:13 AM
  • there is a license link on the site itself. afaik, you can use it freely. that sample is actually from the Sync Fx team.
    Tuesday, October 30, 2012 2:12 AM
    Moderator