Re: XSLTransformer.transform method - thread safe?

Laurent Bihanic <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi,

[email protected] wrote:
> I've just had an XSL transform go VERY weird, and I think it may be that
> two threads tried to use the same XSLTransformer object at the same time.
> The result seemed to be that it returned the untransformed data.
> 
> I'm using the Saxon 8.9 XSLT2.0 Engine, and also there are some SAXON-SQL
> queries in the XSLT in question.
> 
> The Javadoc states that the XSLTransformer is thread safe, but I'm not sure
> if I've either found an issue with this, or if there's something not
> threadsafe in the Saxon implementation.

XSLTransformer is thread-safe in that it only shares a Templates object 
between transformations and allocate a new TrAX Transformer for every call to 
transform(). JAXP TrAX explicitely requires that Templates be thread-safe.

I don't recall ever having any multi-threading issue with Saxon.

Could it be an initialisation issue where your threads start performing 
transformations before XSLTransformer constructor finishes ?

Laurent

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.