As part of a larger routine I need to export a replica schema to xml from an sde instance (Oracle 11gR1). This routine utilizes the 9.3 Geoprocessor for much of its work and for this particular task intermittently the application will have a catastrophic failure and closedown bypassing any error handling. If I use ArcObjects 9.3.1 everything seems to work just fine.
I have created this process in Python, C#(GP) and C#(AO): �?� Python �?? fails after the 2nd or 3rd try import os, arcgisscripting gp = arcgisscripting.create(9.3) gp.AddToolbox(r"C:\Program Files (x86)\ArcGIS\ArcToolBox\Toolboxes\Data Management Tools.tbx") gp.setproduct("ArcServer") count = 1 while (count < 10): print "Export Schema Attempt " +str(count) try: gp.ExportReplicaSchema_management(r'SDECONNECTION.sde', r'SCHEMAEXPORTFILE'+str(count)+'.xml', 'SCHEMA.REPLICANAME') except Exception, e: print e print gp.getmessages() finally: count = count + 1
Throws the following while crashing: ORA-24550: signal received: Unhandled exception [ATTACH=CONFIG]11167[/ATTACH]
�?� C#(GP) �?? Again crashes after about the 2nd or 3rd try but without any error message: AoInitialize init = null; init = new AoInitialize(); init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer); Geoprocessor GP = new Geoprocessor(); for (int i = 1; i < 10; i++) { Console.WriteLine("Export Schema Attempt " + i.ToString()); try { ExportReplicaSchema ersGP = new ExportReplicaSchema(@"SDECONNECTION.sde", @"SCHEMAEXPORTFILE" + i.ToString() + ".xml", "SCHEMA.REPLICANAME");
GP.Execute(ersGP, null); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.InnerException); object sev = new object(); Console.WriteLine(GP.GetMessages(ref sev)); } }
�?� C#(AO) �?? This seems work fine and I have ran it up to 40 iterations without problems: AoInitialize init = null; init = new AoInitialize(); init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer); IWorkspaceFactory2 wFactory = new SdeWorkspaceFactoryClass(); IWorkspace repWorkspace = null; repWorkspace = wFactory.OpenFromFile(@"SDECONNECTION.sde", 0); IWorkspaceReplicas workspaceReplicas = (IWorkspaceReplicas)repWorkspace; IWorkspaceReplicasAdmin workspaceReplicasAdmin = (IWorkspaceReplicasAdmin)repWorkspace;