Re: [digester] how to make digester thread safe ?

2006-07-02 Thread Simon Kitching
On Tue, 2006-06-27 at 17:26 +0200, Nicolas De Loof wrote:
 Hello guys,
 
 My app recieves an  XML doc that is parsed using commons-digester. As a 
 digester instance is not thread-safe, I have to build a new digester on 
 every incoming request based on my rules file.
 Is there a way to create a template digester from rules and to clone 
 for a specific thread, to avoid parsing the rules on each request ?
 Or is it better to use a digester pool ?

A pool of Digester instances isn't a good idea. Digester instances
aren't reusable as described in the documentation; see also the FAQ
entry about reusing instances:
  http://wiki.apache.org/jakarta-commons/Digester/FAQ

And unfortunately I don't know of any way to cache the set of rules
generated from an xmlrules file. You can certainly read the xmlrules
file into memory as a string, and wrap that in an InputSource so that
the xmlrules parsing at least doesn't have to do file I/O.  However
beyond that I don't know of any performance optimisations available.


Regards,

Simon




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



[digester] how to make digester thread safe ?

2006-06-27 Thread Nicolas De Loof


Hello guys,

My app recieves an  XML doc that is parsed using commons-digester. As a 
digester instance is not thread-safe, I have to build a new digester on 
every incoming request based on my rules file.
Is there a way to create a template digester from rules and to clone 
for a specific thread, to avoid parsing the rules on each request ?

Or is it better to use a digester pool ?

Nico.



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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