We have a class that puts together a SAX processing chain. We have put together a threaded test driver to exercise instances of this class concurrently and we're seeing some anomalous behavior involving whitespace. We're seeing extra line breaks and non breaking spaces introduced into the final output stream.

Each instance of this class has it's own instances of the core processing components:

- Serializer (up to three instances per transformation thread)
- XMLReader (never more than one per thread)
- TransformerHandlers (up to two per transformation thread)
- custom classes implementing the ContentHandler interface

The only (static) class instances (knowingly) shared across these threads are:

- Templates for different transformations we may perform.
- Property generated from OutputPropertiesFactory configured for XML output.
- Property generated from OutputPropertiesFactory configured for HTML output..


None for our final output is mangled or missing; we just seem to have extra whitespace. A transformation sequence might capture the raw XML input to a file, capture a generated intermediate XML form to a file, and/or capture a final HTML display output to a file. All of the discrepancies so far have been in the final HTML output.

We have never seen any differences in the output from run to run doing these transformations in a single thread. Running in three threads has generated discrepancies, but not consistently. Running with six threads seems to consistently generate discrepancies. The discrepancies are not predictable or consistent from run to run.

My understanding is that Templates should be thread safe and I would not expect the Property objects returned from OutputPropertiesFactory to be a problem.

I'd appreciate any light anyone might be able to shed on this problem.

Thanks,
Ed Knoll

--
Edward L. Knoll   Phone (FedEx)     : (719)484-2717
                  e-mail (FedEx)    : [EMAIL PROTECTED]
                  e-mail (personal) : [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to