Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am synchronizing a one-way replica in ArcEditor using Python. I tried adding RefreshActiveView and RefreshCatalog to the code, but I still need to refresh the synchronized database to see the results. Here is a code snippet:

Connection_to_geoDBReplicationTest = "C:\Connection to geoDBReplicationTest.sde"

Connection_to_geoDBRepTest_2 = "C:\Connection to geoDBRepTest_2.sde"

arcpy.SynchronizeChanges_management(Connection_to_geoDBReplicationTest_sde,
 "GISUSER.timedTestReplica2", Connection_to_geoDBRepTest_2, "FROM_GEODATABASE1_TO_2",
 "IN_FAVOR_OF_GDB1", "BY_OBJECT", "DO_NOT_RECONCILE")

arcpy.RefreshCatalog(Connection_to_geoDBRepTest_2)

arcpy.RefreshActiveView()

Any thoughts? the code does work, but I would prefer the user did not need to refresh the database in ArcCatalog each time...

share|improve this question
    
Is the child connected to the Default version on geoDBRepTest? –  blord-castillo Jun 10 '12 at 17:41
add comment

1 Answer 1

Not sure if it will help in your case, but you might want to add a garbage collect prior to running both refreshes. This has worked for me in the past where an empty results database wouldn't allow itself to be deleted by a script.

import arcpy, gc

synchronize changes

gc.collect()
refresh catalog
refresh active view
share|improve this answer
    
Thanks, I will try that. –  Jason Jun 11 '12 at 20:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.