Re: ThreadSafe Parser

2001-10-31 Thread Sam Ruby
Berin Loritsch wrote: > > Sam, has Xerces fixed the concurrency issues with their Parser? Basically > what happened is the Parser could be reused until a SAXException happened > (something about a class not being found or something weird like that), > and once that SAXException happened, the Pars

Re: ThreadSafe Parser

2001-10-31 Thread Giacomo Pati
Quoting Sylvain Wallez <[EMAIL PROTECTED]>: > Hi team, > > After seeing the recent changes to Parser, I wondered why this component > cannot be ThreadSafe. The answer is simple : Parser extends XMLProducer > and thus setConsumer() must be called before parse(). > > Searching for Parser use in t

Re: ThreadSafe Parser

2001-10-31 Thread Berin Loritsch
Sam Ruby wrote: > > Sylvain Wallez wrote: > > > > According to the JAXP spec, small synchronized blocks around calls to > > SAXParserFactory.newSAXParser() and > > DocumentBuilderFactory.newDocumentBuilder() should to the trick. This is > > faster than pooling that involves much more code, includ

Re: ThreadSafe Parser

2001-10-31 Thread Berin Loritsch
+10! Sylvain Wallez wrote: > > Hi team, > > After seeing the recent changes to Parser, I wondered why this component > cannot be ThreadSafe. The answer is simple : Parser extends XMLProducer > and thus setConsumer() must be called before parse(). > > Searching for Parser use in the sources, I

Re: ThreadSafe Parser

2001-10-31 Thread Sylvain Wallez
Sam Ruby a écrit : > > Sylvain Wallez wrote: > > > > According to the JAXP spec, small synchronized blocks around calls to > > SAXParserFactory.newSAXParser() and > > DocumentBuilderFactory.newDocumentBuilder() should to the trick. This is > > faster than pooling that involves much more code, i

Re: ThreadSafe Parser

2001-10-31 Thread Sam Ruby
Sylvain Wallez wrote: > > According to the JAXP spec, small synchronized blocks around calls to > SAXParserFactory.newSAXParser() and > DocumentBuilderFactory.newDocumentBuilder() should to the trick. This is > faster than pooling that involves much more code, including some > synchronized blocks.

Re: ThreadSafe Parser

2001-10-31 Thread Sylvain Wallez
Carsten Ziegeler a écrit : > > Hi Sylvain, > > unfortunately the underlying JAXP classes (SAXParserFactory etc.) > are not guaranteed to be thread safe. As the parser uses them > in the parse method, it cannot be thread safe either. According to the JAXP spec, small synchronized blocks around

RE: ThreadSafe Parser

2001-10-31 Thread Carsten Ziegeler
Hi Sylvain, unfortunately the underlying JAXP classes (SAXParserFactory etc.) are not guaranteed to be thread safe. As the parser uses them in the parse method, it cannot be thread safe either. But changing the parser interface in a way you suggest, will be considered when it's moved to Avalon (