Client Scope and Server Scope does not match - throws "Scope doesnot exists" exception
-
Samstag, 12. Mai 2012 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?
- Bearbeitet b_abrams Montag, 14. Mai 2012 05:14
Alle Antworten
-
Montag, 14. Mai 2012 07: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
-
Montag, 14. Mai 2012 09: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?
-
Montag, 14. Mai 2012 09:36Moderatordo you use a different scope name for each location/client?
-
Montag, 14. Mai 2012 11:09No,I use the same scope name for different locations.
-
Montag, 21. Mai 2012 07:36Moderator
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?