POST
|
Replication uses versions to control changes but these versions are hidden and the names change continually behind the scenes when replicas are synced. Writing code to compare these can get tricky because you need your code to test for the current hidden replica parent version name. What way are you replicating? If changes are pushed from child to parent you could make a child version off of SDE.Default in the parent geodatabase (e.g. call it ReplicaSource) . Then make the replica using this version, ReplicaSource, as the parent. Now when replicas are synced changes will go to the ReplicaSource version in the parent SDE database and not SDE.Default. So you can use the well documented ArcObjects classes to compare versions, ReplicaSource to SDE.Default, instead of having to compare replicas. Archiving might also work but it will not tell you what version created what feature, it will only tell you when a feature was created or changed. Thank you, Drew. Replication is from parent to child (one way) and we do not own the parent. I think for our needs, archiving on the child is going to do the trick. Below is the basic idea in case it is helpful to others. // Cast to the IHistoricalWorkspace interface and get default version and the version as of the start of the day
IHistoricalWorkspace historicalWorkspace = (IHistoricalWorkspace)workspace;
IHistoricalVersion defaultVersion = historicalWorkspace.FindHistoricalVersionByName(historicalWorkspace.DefaultMarkerName);
IHistoricalVersion historicalVersion = historicalWorkspace.FindHistoricalVersionByTimeStamp(DateTime.Today);
// Cast both versions to IFeatureWorkspace and open the table from each.
IFeatureWorkspace defaultFWS = (IFeatureWorkspace)defaultVersion;
IFeatureWorkspace historicalFWS = (IFeatureWorkspace)historicalVersion;
ITable defaultTable = defaultFWS.OpenTable(tableName);
ITable historicalTable = historicalFWS.OpenTable(tableName);
// Create a difference cursor to compare what has happened since the start of the day
IVersionedTable versionedTable = (IVersionedTable)defaultTable;
IDifferenceCursor differenceCursor = versionedTable.Differences(historicalTable, differenceType, null);
... View more
04-16-2013
02:08 PM
|
0
|
0
|
222
|
POST
|
As I continue to investigate I found the following on Archiving. Possibly this is the way to go? http://resources.arcgis.com/en/help/main/10.1/index.html#/Geodatabase_archiving/003n000000sr000000/
... View more
04-12-2013
11:18 AM
|
0
|
0
|
222
|
POST
|
The scenario is I have a one way replication from one ArcSDE to another. I would like to run a daily task that will look into the target ArcSDE with ArcObjects and find what is new since the last sync and then run business logic on that set of data. My understanding was that replication was bult on versioning and that each sync would create a new version. I already have plenty of sample code on how to get the diff between two versions. But what I have found is that on the target SDE the default version gets updated inline. There is not a new version created. After much searching it looks like the ReplicationDataChanges or DataChanges classes might be what I am looking for but I have not been able to find much detail on usage or example data. 1. Am I on the correct path for what I want to do? 2. Can you point me toward any sample code? Thank you, Gary
... View more
04-12-2013
11:04 AM
|
0
|
3
|
499
|
POST
|
Before I got around to writing a little C++ app I found that double clicking the ESLF opens a wizard to add your licenses to the License manager. After doing so you don't need to call pAuth.AuthorizeASRFromFile(asrLocation, password) ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop)
Dim aoInit As IAoInitialize = New AoInitializeClass
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB)
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine) Does the trick and I don't need to find out what the heck is wrong with esri's SDK code.
... View more
02-22-2013
06:39 AM
|
0
|
0
|
595
|
POST
|
Thank you, Richard. I will give that a try and hopefully see something useful.
... View more
02-20-2013
11:58 AM
|
0
|
0
|
595
|
POST
|
Background: I am trying to authorize using an ESLF file from ESRI in code. The method calls are the same as used in 10.0 to authorize against an ASR file. When I call: pAuth.AuthorizeASRFromFile(asrLocation, password) I get "Error HRESULT E_FAIL has been returned from a call to a COM component." The error code is -2147467259 I have searched ESRI and Google but have not been able to find this error code. The ESLF file is in the app folder next to the former 10.0 ASR file. The password is the same as the old ASR file according to ESRI. I used Process Monitor to check if there was a security issue with the service accessing the file. The file never pops up in PM. And just to check that there was not an issue with my PM filter I clicked on the file in explorer and PM immediately registers the file access. Any ideas? This should not be that difficult. -Gary
... View more
02-14-2013
02:35 PM
|
0
|
6
|
4096
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|