none
Local data cache resets RRS feed

  • Question

  • Hi

    I've started using the sync framework 2.1 with one of my projects, using SQLCE for the client and SQLSRVR 2008 for the server.

    Everything is working and I'm able to sync, but the data on the client is only available while I have the application running. If I restart the application all the sync data is lost and I have to resync to get the data from the server. This doesn't happen every time but it will eventually happen, its like there is some sort of session time out...

     The client database is reset to the initial state when I first configured the application for sync.

    I'm using LLBLGen for the entity modelling, but this seems to be working as it is showing the reflected sync changes.

    Any help would be appreciated.

     

     

    Friday, August 19, 2011 3:05 AM

All replies

  • which provider are you using? did you use the Local Database Cache Wizard?
    Friday, August 19, 2011 4:03 AM
    Moderator
  • Yes, I used the Local Database Cache Wizard.
    Friday, August 19, 2011 4:06 AM
  • when you say you're losing data, you mean the downloaded data from initial sync is wiped out? or you mean changes you make to your local cache is overwritten by server data? have you checked that your app is not copying or creating a new SDF file in between runs?

    Friday, August 19, 2011 4:21 AM
    Moderator
  • when you say you're losing data, you mean the downloaded data from initial sync is wiped out? 

    I start my application and it has the initial data, I add new data and sync. The data is sync'd to the server, then if I restart the application, the new data is no longer available in my local CE database, but if I sync with the server the new data (which the server has) will be download into my local copy again.

    The local CE database is not keeping any new data.

    or you mean changes you make to your local cache is overwritten by server data?

    No the data  is getting to the server, so when I do a resync I end up getting the original data back into my local db. Then I lose it again at some point e.g. I had the data yesterday, when I restarted the app this morning the local data was gone, until I did a resync.

    have you checked that your app is not copying or creating a new SDF file in between runs?

    I added the SDF file to my project and its 'Build Action' is set to content and the 'Copy to Output Directory' was set to Copy Always (maybe I should change this to Copy if newer). There is no other place in my application where the SDF file is created or copied.

    Friday, August 19, 2011 4:35 AM
  • i suggest you look at the Build Action and test.
    Friday, August 19, 2011 5:06 AM
    Moderator