I have an Engine Runtime application that syncs SDE Replicas on demand and at a scheduled interval. When I run the code below I get the following error:
The application is not licensed to perform this operation, Error Code: -2147220959
The funny thing is that it appears to work, that is, changes in the parent are pushed to the children. But in the SDE table GDB_REPLICALOG, it shows the error code above. From the documentation I've read IReplicationAgent.SynchronizeReplica() is supported in Engine. So why am I getting this error? Any help would be appreciated.
Thanks.
Example Code:
Private Sub SynchronizeReplica(parentGDS As IGeoDataServer, childGDS As IGeoDataServer,
replicaName As String, conflictPolicy As esriReplicationAgentReconcilePolicy,
syncDirection As esriReplicaSynchronizeDirection, columnLevel As Boolean)
Try
Dim parentReplica As IGPReplica
parentReplica = GetReplicaByName(parentGDS, replicaName)
Dim childReplica As IGPReplica
childReplica = GetReplicaByName(childGDS, replicaName)
' Synchronize the replica.
Dim replicationAgent As IReplicationAgent = New ReplicationAgentClass()
replicationAgent.SynchronizeReplica(parentGDS, childGDS, parentReplica, childReplica, conflictPolicy, syncDirection, columnLevel)
Catch comExc As COMException
Throw New Exception(String.Format("Create replica errored: {0}, Error Code: {1}", comExc.Message, comExc.ErrorCode), comExc)
Catch exc As Exception
Throw New Exception(String.Format("Create replica errored: {0}", exc.Message), exc)
End Try
End Sub
The application is not licensed to perform this operation, Error Code: -2147220959
The funny thing is that it appears to work, that is, changes in the parent are pushed to the children. But in the SDE table GDB_REPLICALOG, it shows the error code above. From the documentation I've read IReplicationAgent.SynchronizeReplica() is supported in Engine. So why am I getting this error? Any help would be appreciated.
Thanks.
Example Code:
Private Sub SynchronizeReplica(parentGDS As IGeoDataServer, childGDS As IGeoDataServer,
replicaName As String, conflictPolicy As esriReplicationAgentReconcilePolicy,
syncDirection As esriReplicaSynchronizeDirection, columnLevel As Boolean)
Try
Dim parentReplica As IGPReplica
parentReplica = GetReplicaByName(parentGDS, replicaName)
Dim childReplica As IGPReplica
childReplica = GetReplicaByName(childGDS, replicaName)
' Synchronize the replica.
Dim replicationAgent As IReplicationAgent = New ReplicationAgentClass()
replicationAgent.SynchronizeReplica(parentGDS, childGDS, parentReplica, childReplica, conflictPolicy, syncDirection, columnLevel)
Catch comExc As COMException
Throw New Exception(String.Format("Create replica errored: {0}, Error Code: {1}", comExc.Message, comExc.ErrorCode), comExc)
Catch exc As Exception
Throw New Exception(String.Format("Create replica errored: {0}", exc.Message), exc)
End Try
End Sub