Client Scope and Server Scope does not match - throws "Scope doesnot exists" exception

Unanswered Client Scope and Server Scope does not match - throws "Scope doesnot exists" exception

  • 2012年5月12日 15:21
     
      コードあり

    Hi,

    My client in other location uses Ipad to sync with service hosted in my machine. He is able to download changes but during uploadchanges my

    service is throwing "scope does not exists" exception. while debugging i found the below code where the exception is throwing..

    we are using a central provisioned database in which all ipad applications syncs data with. 

     // Set the scope name in the response blob.
                syncBlob.ClientScopeName = incomingBlob.ClientScopeName;
                
                // If the requested scope does not exists, then throw an error since we 
                // don't initialize scopes on upload requests.
                if (!CheckIfScopeExists())
                {
                    throw SyncServiceException.CreateResourceNotFound("Scope does not exist");
                }

     I have follwed the exact steps mentioned in help doc to provision database and of generating server files.my client is using sqllite as offline database in his Ipad. Above mentioned code is part if sync fx toolkit library. Please help , why this error happens?



    • 編集済み b_abrams 2012年5月13日 13:45
    • 編集済み b_abrams 2012年5月14日 5:14
    •  

すべての返信

  • 2012年5月14日 7:09
     
     

    Your client tries to upload for a "scope" which is unknown on the server:

    For every distinct sync relation with a particular client the server creates a concrete sync scope (based off a sync scope template) on first download request. This sync scope then is used for maintaining any up- and downloads within this particular client-server-relation.

    Scopes are stored in scope_info table. CheckIfScopeExists returns false because the scope info received from the client could not be found on the server.

    This can happen e.g. when you restore a backup of the server database and the backup does not include the scope for the particular client (backup was created before initial download request from this client). There are other reasons for why a scope_info gets lost but they are rather esoteric.




    Senior Jack of all trades

  • 2012年5月14日 9:20
     
     

    Thanks M.Bi for the reply.

    Makes sense. my client test his Ipad application with multiple service hosted in different locations. When he switches the url it throws this exceptions and he restarts the application,clears the cache and tries to sync.it works. so does it have any dependency with client cache?

  • 2012年5月14日 9:36
    モデレータ
     
     
    do you use a different scope name for each location/client?
  • 2012年5月14日 11:09
     
     
    No,I use the same scope name for different locations.
  • 2012年5月21日 7:36
    モデレータ
     
     

    what's the value for this one incomingBlob.ClientScopeName when you get an error?

    "multiple service hosted in different locations" - are these services pointing to the same server database or they have their own database?