locked
Bidirectional Sync raises System.Data.SqlServerCe.SqlCeException RRS feed

  • Question

  • Hi,

    when I add a new datarow on my Client(Windows Mobile 5 Device) and synchronize with Server  i get the following Exception: "System.Data.SqlServerCe.SqlCeException"

    SyncDirection = Bidirectional

    The new datarow is inserted in Server DB properly by the way...

    Running the same Scenario with a Desktop Client instead of Mobile Device,the Exception is never thrown!!

    When i use UploadOnly instead of Bidirectional as my Syncdirection everythings works withoud Exception, on both Device and Desktop-Client...

    Any Idea? Should I ignore the Exception?

    Thanx and regards,
    Thomas


    • Moved by Max Wang_1983 Friday, April 22, 2011 5:55 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, September 1, 2008 1:34 PM

All replies

  • I have some additional Informations about my Problem:

    The SqlServerCeException is  only thrown when i insert new datarows AFTER Initail Sync!!

    When i add some new stuff to my Client before the first Sync everything works fine, but after the first Sync i get the Exception ...

    strange!

    Any Idea?


    Thanx a lot and regards,
    Thomas
    Wednesday, September 3, 2008 9:02 AM
  •  

    no, you should not ignore the exception for sure.

     

    can you provide more details here. do you encounter this exception during sync  ? what is the entire exception, including inner exception, what is call stack ?

     

    thanks

    Yunwen

    Thursday, September 4, 2008 7:34 AM
    Moderator
  • Hi Yunwen :-),

    I am not able to catch the exception,in cause i can't post the entire exception. It occours during sync. The exception is thrown in a seperated thread.

    It is not possible to catch the Exception by surrounding the Synchronize() Method with Try/Catch Block so it must be in a seperate Thread...

    The console only shows "Eine Ausnahme (erste Chance) des Typs "System.Data.SqlServerCe.SqlCeException" ist in System.Data.SqlServerCe.dll aufgetreten."

    If I add a new DataRow on client, SyncStatistics shows Upload Changes Applied: 1. Download Changes Failed: 1.

    The databaselayout is very simple. One Table with ID(uniqueidentifier), Username, Password, _CreationDate, _LastEditDate. On Client side I fill the ID, Username and Password fields. _CreationDate and _LastEditDate are created on MSSQL Server.

    I used the Visual Studio 2008 build-in wizard to create the DataCaches. ADO.NET Sync Services v1.0 and Compact Framework 3.5. Version of System.Data.SqlServerCe.dll is 3.5.1.0.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Beside this i found out the following:
    I'm using a ASP.NET Webservice and not a WCF Service.

    Could it be possible that i have to add service and behaviour lines to the app.config though i am not using WCF?

    If I attach debugger to the remote service (w3wp.exe and services.exe) I see the following in the console:

    Der Thread 0x2dc68c8a hat mit Code 0 (0x0) geendet.
    Der Thread '<Kein Name>' (0xef25813a) hat mit Code 0 (0x0) geendet.
    Der Thread 0xef25813a hat mit Code 0 (0x0) geendet.
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: EEFileLoadException an Speicherposition 0x054fb2c4..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: EEFileLoadException an Speicherposition 0x054fb2c4..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: Microsoft C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..
    Der Thread 'Win32 Thread' (0xc3c) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0xb0) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0x610) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0x5d4) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0xb4) hat mit Code 0 (0x0) geendet.
    "w3wp.exe": "C:\WINDOWS\system32\security.dll" wurde geladen
    Eine Ausnahme (erste Chance) bei 0x7c80bee7 in w3wp.exe: 0x000006D9: In der Endpunktzuordnung sind keine weiteren Endpunkte verfügbar.
    Der Thread 0x2dc68c8a hat mit Code 0 (0x0) geendet.
    Der Thread 0xdb3ff1a hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0x89c) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0xea8) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0xfc0) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0xb08) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0xe98) hat mit Code 0 (0x0) geendet.
    Der Thread 'Win32 Thread' (0x870) hat mit Code 0 (0x0) geendet.

    thanks
    thomas

    Thursday, September 4, 2008 9:54 AM
  • something doesn't seem make a sense in this case, if you just made a change at client, the downloading statistics numbers should be all zero. can you confirm there is no data changes at the server ?

     

    the current VS wizard only generates code for the downloading sceanrios. have you follow this post  http://blogs.msdn.com/sync/archive/2008/06/16/extending-visual-studio-2008-sp1-sync-designer-to-support-bi-directional-synchronization.aspx to enable the app to support bidirectional ?

     

    do you have ApplyChangesFailed event implemented at the client provider ? I suspect the exception came from the downloading time and in one of your event just logged out the exception without re-throwing it.

     

    thanks

    Yunwen

    Friday, September 5, 2008 7:30 AM
    Moderator
  • Hello Yunwen,

    thank you for your reply.

    Thomas and me are working together on this problem.

    I have followed the instructions in the PDF from your link. But I have the same SQLException and statistics.
    If I EDIT a DataRow on client statistics shows Uploads Applied: 1 Downloads Applied: 1.
    On NEW DataRow statistic shows Uploads Applied: 1, Download Changes Failed: 1, Total Changes Downloaded: 1
    I can confirm that on server side no changes were made.

    If it's not too much hassle, here's my project...
    http://necro.hellroot.de/SyncSolutionNeu.zip
    Password: SyncService


    Thank you very much for your help.

    Markus
    Friday, September 5, 2008 2:49 PM
  • Hello again,

    today I've tested same application with SQLServer 2008 Express and everything works fine. No Exception and syncStatistics look good. I've used the SQLServer build-in change tracking.
    But I have no idea why it doesn't work correctly with SQLServer 2005 Express....

    Markus
    Thursday, September 11, 2008 9:22 AM