brian_dillon@trimble.com

setTargetName on GPReplicaDataset ignored?

Discussion created by brian_dillon@trimble.com on Oct 17, 2013
Hi,

I'm trying to create a replica using the SDK (Java at the moment, I might try in C# and see if it has the same issues..)

The setTargetName on the GPReplicaDataset class seems to be ignored when creating a replica!

eg.

.
.
gpReplicaDataset.setName(featureDataset);
gpReplicaDataset.setTargetName(tc_prefix+featureDataset);
.
.
gpReplicaDatasets.add(gpReplicaDataset);
.
.
gpReplicaDesc.setReplicaDatasetsByRef(gpReplicaDatasets);
// or gpReplicaDesc.setReplicaDatasetsByRef(parentGDS.expandReplicaDatasets(gpReplicaDatasets));
.
.
replicationAgent.createReplica("", parentGDS, childGDS, replicaName,
    gpReplicaDesc, replicaOptions);
.
.



Does not create a replica and change the target name .. it keeps the same feature class name

If I create it manually through the wizard using ArcMap it's ok and creates it correctly..
If I export the schema after the replica is created by ArcMap .. I see xml like


<GPReplica xsi:type='esri:GPReplica'>
 <Name>sde.MyReplica</Name>
 <ID>2541</ID>
 <ReplicaVersion>sde.DEFAULT</ReplicaVersion>
 <CreationDate>2013-10-09T16:14:09</CreationDate>
 <GUID>ABC-etc</GUID>
 <Role>esriReplicaRoleParent</Role>
 <AccessType>esriReplicaChildReadOnly</AccessType>
 <MyGenerationNumber>0</MyGenerationNumber>
 <SibGenerationNumber>0</SibGenerationNumber>
 <SibMyGenerationNumber>0</SibMyGenerationNumber>
 <ReplicaState>esriReplicaStateSendingData</ReplicaState>
 <SibConnectionString>connection info here inc enc password + ips etc</SibConnectionString>
 <GPReplicaDescription xsi:type='esri:GPReplicaDescription'>
  <ModelType>esriModelTypeFullGeodatabase</ModelType>
  <SingleGeneration>false</SingleGeneration>
  <SpatialRelation>esriSpatialRelIntersects</SpatialRelation>
  <GPReplicaDatasets xsi:type='esri:ArrayOfGPReplicaDataset'>
   <GPReplicaDataset xsi:type='esri:GPReplicaDataset'>
    <DatasetName>PARENTDB.SDE.MAIN_VALVES</DatasetName>
    <DatasetType>esriDTFeatureClass</DatasetType>
    <RowsType>esriRowsTypeAll</RowsType>
    <IsPrivate>false</IsPrivate>
    <UseGeometry>false</UseGeometry>
    <TargetName>cust_Main_Valves</TargetName>
    <DatasetID>67</DatasetID>
    <ParentOwner>sde</ParentOwner>
    <ParentDBase>parentdb</ParentDBase>
   </GPReplicaDataset>
   <GPReplicaDataset xsi:type='esri:GPReplicaDataset'>
    <DatasetName>PARENTDB.SDE.HYD_VALVES</DatasetName
.
.
etc.

Outcomes