I am writing an application which will UnRegister replicas that are currently available. I managed to unregester new replicas which have the latest Server Url address stored in the DATASET_INFO field, but some of the replicas have an old address stored from a year ago, and those do not get unregistered, I get an exception.

The way I get the Replicas is by querying the gdb_items table, I gather the UUIDs of each replica and the value stored in DATASETINFO which is basically the url address that the replica is on.

The replicas that contain the new address of the server get unregistered just fine, all the replicas that has old address wont get unregistered because the address provided for the replica is not responding since it no longer exists. How can I Unregister those replicas ?

Here is a part of the code where I Unregister them

  public string UnregisterReplica(string user,string password,string url,string token,string replicaUUId) {

        const string unregUrl= "unRegisterReplica";
        if(!url.EndsWith("/")) {
            url += "/" + unregUrl;
        } else
            url += unregUrl;

        var values = new NameValueCollection
   { "username", user},
   { "password", password },

        using(var wc = new WebClient()) {
            try {
                var result = wc.UploadValues(url,"POST",values);
                var response = Encoding.Default.GetString(result);
                return response;

            } catch(Exception ex) {
               LoggingManager.LogException("Exception Occured during request made on Url:" + url,ex);
                return null;

The exception I get when trying to unregister is as follows "Unable to connect to the remote server" "{"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"}"

Edits:- So I looked through the sde tables to see if i can make up the relationships between the tables that hold the replicas, unfortunately I ended up at xml tables that I can't figure out. What I am trying to do now, is if the url is incorrect, I should just manually erase those replica records from the sde tables, but I am not sure which tables will take care of this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.