You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by David Orriss Jr <da...@davenet.net> on 2002/10/23 01:48:09 UTC

Xerces and Thread Safety..?

I'm attempting to write some performance tests against Xerces 1.4.4 right now.
Just for some background I've noticed that Xerces-J 2 will include a
CachingParserPool class that would probably take care of what I need.  But at
the moment I have to use 1.4.4.  That said, I just have a simple question.  How
thread-safe is Xerces 1.4.4 when it comes to parsing documents against a schema
(as opposed to a DTD)?

>From the looks of things, in a multi-threaded environment (like a servlet
engine), I would have to have a parser pool available, get a parser from the
pool, do my work, and then return the parser to the pool.

Sound reasonable??

--
David Orriss Jr.
dave@davenet.net
http://www.davenet.net
Want ICQ/AIM/MSN ID's? Just Ask...
Linux - Chicken Soup for the Unix Soul



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces and Thread Safety..?

Posted by David Orriss Jr <da...@davenet.net>.
On Wednesday, October 23, 2002 11:01 AM [GMT+0100=CET],
Andy Clark <an...@apache.org> wrote:

> David Orriss Jr wrote:
>> I was just back up at the Apache XML site.  Was 2.2 just released or
>> something?? I don't remember seeing the mention of it there a couple
>> of weeks ago... 
> 
> Xerces 2.2.0 was released on 9/27 to the xerces-j-user,
> xerces-j-dev, general, and announcements mailing lists.

Serves me right for not being on the lists at that time... :-/

Oh well, off to check out Xerces 2.2 -- looks like it'll be just the ticket.

-- 
David Orriss Jr.
dave@davenet.net
http://www.davenet.net
Want ICQ/AIM/MSN ID's? Just Ask...
Linux - Chicken Soup for the Unix Soul



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces and Thread Safety..?

Posted by Andy Clark <an...@apache.org>.
David Orriss Jr wrote:
> I was just back up at the Apache XML site.  Was 2.2 just released or something??
> I don't remember seeing the mention of it there a couple of weeks ago...

Xerces 2.2.0 was released on 9/27 to the xerces-j-user,
xerces-j-dev, general, and announcements mailing lists.

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces and Thread Safety..?

Posted by David Orriss Jr <da...@davenet.net>.
On Wednesday, October 23, 2002 2:25 AM [GMT+0100=CET],
Andy Clark <an...@apache.org> wrote:

>
> Yep, that's the way to do it. This would save you
> having to recreate parser objects each time. Xerces
> 1.x doesn't have the ability to cache grammars,
> though, so the grammars would need to be reloaded
> each time. But you improve performance in this
> respect by buffering the grammars in memory and
> using a custom entity resolver to let the parser
> retrieve them.

I was just back up at the Apache XML site.  Was 2.2 just released or something??
I don't remember seeing the mention of it there a couple of weeks ago...

--
David Orriss Jr.
dave@davenet.net
http://www.davenet.net
Want ICQ/AIM/MSN ID's? Just Ask...
Linux - Chicken Soup for the Unix Soul



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Identify schemaLocation using https?

Posted by David Orriss Jr <da...@davenet.net>.
On Thursday, October 24, 2002 8:09 AM,
Roger L. Costello <co...@mitre.org> wrote:

> Hi Folks,
>
> Does xerces have the capability to access an XML Schema using https?
>
> Example:
>
>     schemaLocation = " some-namespace
>                        https://www.publishing.com/bookcatalogue.xsd "
>


That is an *excellent* question.  So far I haven't found anything that shows it
supports it... :-/

--
David Orriss Jr.
dave@davenet.net
http://www.davenet.net
Want ICQ/AIM/MSN ID's? Just Ask...
Linux - Chicken Soup for the Unix Soul



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Identify schemaLocation using https?

Posted by "Roger L. Costello" <co...@mitre.org>.
Hi Folks,

Does xerces have the capability to access an XML Schema using https?  

Example:

    schemaLocation = " some-namespace
                       https://www.publishing.com/bookcatalogue.xsd "

[Note the use of https.]

/Roger


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces and Thread Safety..?

Posted by Andy Clark <an...@apache.org>.
David Orriss Jr wrote:
> When you say 'grammar' I assume you mean the same thing as 'schema'.  Based
> on that, if all parsers in the pool use the same schema, couldn't I just set
> the schema at initialization of the parser?

When I say "grammar", I mean anything that defines
validation rules such as DTD, XML Schema, etc.

The Xerces 1.x codebase didn't have the ability to
cache pre-loaded grammars of any kind. So all of
that work would need to be done for every parse.
And if the documents were small and the grammar big
(e.g. DocBook, etc), then this could represent a
large portion of the parsing time.

However, Xerces2 now has grammar caching so if
validation performance is required, then this is
definitely the way to go.

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces and Thread Safety..?

Posted by David Orriss Jr <da...@davenet.net>.
On Wednesday, October 23, 2002 2:25 AM,
Andy Clark <an...@apache.org> wrote:

> David Orriss Jr wrote:
>> From the looks of things, in a multi-threaded environment (like a servlet
>> engine), I would have to have a parser pool available, get a parser from
the
>> pool, do my work, and then return the parser to the pool.
>>
>> Sound reasonable??
>
> Yep, that's the way to do it. This would save you
> having to recreate parser objects each time. Xerces
> 1.x doesn't have the ability to cache grammars,
> though, so the grammars would need to be reloaded
> each time. But you improve performance in this
> respect by buffering the grammars in memory and
> using a custom entity resolver to let the parser
> retrieve them.

When you say 'grammar' I assume you mean the same thing as 'schema'.  Based
on that, if all parsers in the pool use the same schema, couldn't I just set
the schema at initialization of the parser?


--
David Orriss Jr.
dave@davenet.net
http://www.davenet.net
http://www.codeskanks.com

Please email me if you want my ICQ/AIM/IM ID's.



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces and Thread Safety..?

Posted by Andy Clark <an...@apache.org>.
David Orriss Jr wrote:
> From the looks of things, in a multi-threaded environment (like a servlet
> engine), I would have to have a parser pool available, get a parser from the
> pool, do my work, and then return the parser to the pool.
> 
> Sound reasonable??

Yep, that's the way to do it. This would save you
having to recreate parser objects each time. Xerces
1.x doesn't have the ability to cache grammars,
though, so the grammars would need to be reloaded
each time. But you improve performance in this
respect by buffering the grammars in memory and
using a custom entity resolver to let the parser
retrieve them.

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org