locked
Establishing Connection to Database Takes Several Minutes After Downloading Snapshot RRS feed

  • Question

  • I don't think this is a sync specific issue necessarily, but something that a sync developer may have insight into.  I've posted on SQL CE forum also. 

    I'm using the sync framework and generating an initial database (.sdf file) on the server and pulling it down to my mobile device via a WCF service.  That works fine with one caveat.  When my windows mobile app goes to connect to this database it takes 5 minutes to open the connection.  It seems to be consistently 5 minutes so I was thinking there is a timeout somewhere in play. 

    Maybe something else is holding on to the new .sdf file i downloaded?  Maybe my sqlceconnection object thinks it is connected to an old instance of the .sdf and after it figures that out it connects to the new one?  I'm pretty confident I don't have an old connection, but maybe the sync components do or something.  It seems like the .sdf grows a little during this time (is it doing something to prepare the database or something?).

    I can't figure out what is happening here. Anyone have any ideas on what to look for?

    Monday, October 18, 2010 8:40 PM

Answers

  • hi brian,

    does it happen only the first time you open the SDF in the device?

    if i remember it right, CE drops and recreates indexes when language settings is different from where the database was created and where its being opened. also worth noting that since CE doesnt have a service itself, it needs to create some memory structures during the first connection.

    Tuesday, October 19, 2010 2:39 AM

All replies

  • hi brian,

    does it happen only the first time you open the SDF in the device?

    if i remember it right, CE drops and recreates indexes when language settings is different from where the database was created and where its being opened. also worth noting that since CE doesnt have a service itself, it needs to create some memory structures during the first connection.

    Tuesday, October 19, 2010 2:39 AM
  • I'm creating the sdf on Windows Server 2008.  Can I specify something to make the "language settings" more compatible with the device?

    Also, I took out the indexes that were being created on the server and it seems to have reduced the time it takes to open the database the first time to 1 to 2 minutes.  It seems to be consistent whether i download the .sdf via my service or manually copy it over to the device.  I'm going to look into creating the indexes on the device if they're just being recreated anyway.  This should at least allow me to give a better feedback to the user during the process and reduce the size for download.

     

    Tuesday, October 19, 2010 12:52 PM
  • Tuesday, October 19, 2010 1:29 PM