Error Message: The workspace is not connected

8579
7
11-26-2011 03:29 AM
MoizIshfaq
New Contributor II
Hello everyone,
I am trying to automate replication for ArcSDE and am trying to follow instructions from ESRI webhelp at URL 'http://help.arcgis.com/en/sdk/10.0/vba_desktop/conceptualhelp/index.html#/How_to_create_a_replica/00...'. I am consistently getting an error message saying '"The workspace is not connected"'. I tried searching the forum for this error but could not get find anything useful in this regard.

I am using C# and ArcGIS Desktop 10. Any helpful insight would be appreciated in this regard.

Thanks in advance.

// *******Code Snippet************

IGeoDataServer geoDataServer=null;
IGeoDataServerInit geoDataServerInit;

geoDataServer = new GeoDataServerClass();
geoDataServerInit = (IGeoDataServerInit)geoDataServer;
geoDataServerInit.InitFromConnectionString(gdbConnectionString);

IReplicationAgent pRepAgent;
IGPReplicaOptions2 pReplicaOptions;
IGPReplicaDescription pGPReplicaDesc;
IGPReplicaDatasets pGPReplicaDatasets;
IGPReplicaDatasets pGPReplicaDatasets_Expand;
IGPReplicaDataset pGPReplicaDataset;

pGPReplicaDesc = new GPReplicaDescriptionClass();
pGPReplicaDatasets = new GPReplicaDatasetsClass();
pGPReplicaDataset = new GPReplicaDatasetClass();

               
pGPReplicaDataset.DatasetType = esriDatasetType.esriDTFeatureDataset;
pGPReplicaDataset.Name = "SampleFeatureDatasetName";

pGPReplicaDatasets.Add(pGPReplicaDataset);
pGPReplicaDatasets_Expand = sourceGeoDataServer.ExpandReplicaDatasets(pGPReplicaDatasets);

pGPReplicaDesc.ReplicaDatasets = pGPReplicaDatasets_Expand;
pGPReplicaDesc.ModelType = esriReplicaModelType.esriModelTypeFullGeodatabase;

pGPReplicaDesc.SingleGeneration = (lAccType == esriReplicaAccessType.esriReplicaAccessNone);
pGPReplicaDesc.SpatialRelation = esriSpatialRelEnum.esriSpatialRelIndexIntersects;

pReplicaOptions = new GPReplicaOptionsClass();
pReplicaOptions.AccessType = lAccType;
pReplicaOptions.ChildReconcilePolicy = esriReplicaReconcilePolicyType.esriReplicaResolveConflictsInFavorOfImportedChanges;
pReplicaOptions.ParentReconcilePolicy = esriReplicaReconcilePolicyType.esriReplicaResolveConflictsNone;
pReplicaOptions.IsChildFirstSender = true;

pRepAgent = new ReplicationAgent();
               
pRepAgent.CreateReplica(versionName, sourceGeoDataServer, targetGeoDataServer, replicaName, pGPReplicaDesc, pReplicaOptions);
0 Kudos
7 Replies
MoizIshfaq
New Contributor II
Greetings,
It has been almost 5 days that I posted this thread and it has been viewed 39 times by different users and yet no one responded to it. I am just following what instructions are given in ESRI Documentation. Is it really a problem or I am making any mistake? Can anyone from ESRI technical team respond in this regard?

Thanks.
0 Kudos
RichardWatson
Frequent Contributor
Other than Googling the error message, I haven't a clue. 

I suspect that the number of people programming replication is not that large.

I suggest that you file an incident with ESRI support.
0 Kudos
MoizIshfaq
New Contributor II
Thanks Richard,
I would talk to the ESRI customer support in this regard.
0 Kudos
JoshWerts
New Contributor III
Hello everyone,
I am trying to automate replication for ArcSDE and am trying to follow instructions from ESRI webhelp at URL 'http://help.arcgis.com/en/sdk/10.0/vba_desktop/conceptualhelp/index.html#/How_to_create_a_replica/000100000063000000/'. I am consistently getting an error message saying '"The workspace is not connected"'. I tried searching the forum for this error but could not get find anything useful in this regard.

I am using C# and ArcGIS Desktop 10. Any helpful insight would be appreciated in this regard.

Thanks in advance.

// *******Code Snippet************

IGeoDataServer geoDataServer=null;
IGeoDataServerInit geoDataServerInit;

geoDataServer = new GeoDataServerClass();
geoDataServerInit = (IGeoDataServerInit)geoDataServer;
geoDataServerInit.InitFromConnectionString(gdbConnectionString);

IReplicationAgent pRepAgent;
IGPReplicaOptions2 pReplicaOptions;
IGPReplicaDescription pGPReplicaDesc;
IGPReplicaDatasets pGPReplicaDatasets;
IGPReplicaDatasets pGPReplicaDatasets_Expand;
IGPReplicaDataset pGPReplicaDataset;

pGPReplicaDesc = new GPReplicaDescriptionClass();
pGPReplicaDatasets = new GPReplicaDatasetsClass();
pGPReplicaDataset = new GPReplicaDatasetClass();

               
pGPReplicaDataset.DatasetType = esriDatasetType.esriDTFeatureDataset;
pGPReplicaDataset.Name = "SampleFeatureDatasetName";

pGPReplicaDatasets.Add(pGPReplicaDataset);
pGPReplicaDatasets_Expand = sourceGeoDataServer.ExpandReplicaDatasets(pGPReplicaDatasets);

pGPReplicaDesc.ReplicaDatasets = pGPReplicaDatasets_Expand;
pGPReplicaDesc.ModelType = esriReplicaModelType.esriModelTypeFullGeodatabase;

pGPReplicaDesc.SingleGeneration = (lAccType == esriReplicaAccessType.esriReplicaAccessNone);
pGPReplicaDesc.SpatialRelation = esriSpatialRelEnum.esriSpatialRelIndexIntersects;

pReplicaOptions = new GPReplicaOptionsClass();
pReplicaOptions.AccessType = lAccType;
pReplicaOptions.ChildReconcilePolicy = esriReplicaReconcilePolicyType.esriReplicaResolveConflictsInFavorOfImportedChanges;
pReplicaOptions.ParentReconcilePolicy = esriReplicaReconcilePolicyType.esriReplicaResolveConflictsNone;
pReplicaOptions.IsChildFirstSender = true;

pRepAgent = new ReplicationAgent();
               
pRepAgent.CreateReplica(versionName, sourceGeoDataServer, targetGeoDataServer, replicaName, pGPReplicaDesc, pReplicaOptions);


Any chance you have a raster field in your data?  I've set up a 2-way replica through a geodata service (to ArcSDE personal) and synchronized in ArcMap (not programmatically). Everything works fine with adding features and changing attributes until I try to add a photo to a raster field (replica was created fine with some raster fields already populated).  Then I get the "Workspace is not connected" error when I try to synchronize with the geodata service.

Not sure if this is a bug, something I have set up wrong, or just an unsupported feature in my case.

Josh
0 Kudos
MoizIshfaq
New Contributor II
Hello Josh,
No, I am working in pure ArcObjects code and am working with simple feature classes. I have contacted the ESRI Technical Representative in my area and would update if I get any answer in this regard. Please accept my apology as I didn't touch upon what you are experiencing.

Regards.
0 Kudos
ChristianPauschert
New Contributor
I also had this error. I got around it by using a single FeatureClass only instead of replicating a complete FeatureDataset. You can then repeat this for every FeatureClass in the FeatureDataset.
0 Kudos
Corbinde_Bruin
Occasional Contributor II

I received this error when I was accidentally creating a new replica with the same name as an existing replica.

0 Kudos