Forum Post: SAX Reader blocks destructor????

  • Thread starter Thread starter Thomas Mercer-Hursh
  • Start date Start date
Status
Not open for further replies.
T

Thomas Mercer-Hursh

Guest
I have a series of programs which are a part of this tool I am writing which run in sequence. Each writes start and stop messages to the log-manager log as well as any unexpected errors. Each has its own log for "expected" exceptions written to with a logging object. Almost programs are classes with a very similar structure - an Initialize() method which writes the start message, checks the setup, and writes a starting message in the exception list and a Process() method which does the work. Most classes are a subclass of a class which builds a list of files to process according to the setup criteria and a super() call for this is the first thing in Process. Most then call ScanAll() which loops through the list of files and calls ScanOne() which does the actual work. Three of the programs use a SAX-reader to process the input file. The actual procedure is started in Initialize(), ScanOne() checks that it is a correct file to process and does some setup, and then calls ProcessXref(). That method sets up the SAX reader and calls it. The actual methods to handle StartElement, EndElement, and whatever are in the main class so the event procedure is just a skeleton that does callbacks to the main object. This is all working, but with one anomaly. I know that the files are processed and I know that the loop in ScanAll() finishes without any errors. There are both a number of strategic catch blocks within the code and a master catch in the calling procedure which should capture anything into the log. But, the Destructor of all classes, in addition to any cleanup, if any, writes a final line to the exception log about how much work it has done and a Stop line to the log-manager. This works everywhere except in the classes with the SAX parsers. There, I am getting none of the messages from the Destructor and no error messages. Here is one of the Destructors: destructor public BuildTableLinks ( ): obReport:WriteMessage ( substitute("End of scan with &1 total files; &2 compiled with &3 table links and &4 column links",inTotalFiles, inTotalCompiled, inTotalTableLinks, inTotalColumnLinks ) ). if valid-handle(hnXrefHandler) then do: delete procedure hnXrefHandler. hnXrefHandler = ?. end. else log-manager:write-message ("BuildTableLinks: Destructor: Invalid handle for hnXrefHandler"). log-manager:write-message ( substitute( "End of BuildTableLinks with &1 exceptions", inTotalExceptions )). end destructor. Any ideas about what is happening here?

Continue reading...
 
Status
Not open for further replies.
Back
Top