Well can anyone give me an example how to use Templates to do the same
thing that I am doing in Trnasformer and still be thread safe.
TIA
Anamitra


                                                                                
                                   
                    "Christopher                                                
                                   
                    Raber"               To:     <[EMAIL PROTECTED]>, <[EMAIL 
PROTECTED]>       
                    <[EMAIL PROTECTED]       cc:     <[EMAIL PROTECTED]>        
                            
                    o.com>               Subject:     RE: Memory leak or 
threading problem in Xalan-J 2.2?         
                                                                                
                                   
                    01/24/2002                                                  
                                   
                    02:01 PM                                                    
                                   
                                                                                
                                   
                                                                                
                                   




Use Templates.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 24, 2002 1:56 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Memory leak or threading problem in Xalan-J 2.2?
>
>
>
> If Transformers are not thread safe that implies - I cannot
> load in an XSL
> file in a Transformer instance and use it in multiple threads for
> transforming different inputs - using the same XSL mapping - right?
> that will boil down to the fact that I have to do the
> following thing in
> the myTransfor method:
>
>      TransformerFactory tFactory = TransformerFactory.newInstance();
>
>      Transformer transformer = tFactory.newTransformer(new
> StreamSource(xslTXStream));
>
>      transformer.transform(new StreamSource(xmlFileStream), new
> StreamResult(xmlOutFile));
>
>
> Rather than doing
>
>      TransformerFactory tFactory = TransformerFactory.newInstance();
>
>      Transformer transformer = tFactory.newTransformer(new
> StreamSource(xslTXStream));
>  once (say in my classes constructor) and then just doing
>
>      transformer.transform(new StreamSource(xmlFileStream), new
> StreamResult(xmlOutFile));
> in the transform method??
>
> that will be severe performance limitation.
>
> I want to load the XSL rules only once and then reuse it for
> all inputs.
>
> Any thoughts?? - am I talking right??
> Anamitra
>
>
>
>
>
>                     Shane Curcuru
>
>                     <shane_curcuru@       To:
> [EMAIL PROTECTED]
>                     yahoo.com>            cc:
>
>                                           Subject:     Re:
> Memory leak or threading problem in Xalan-J 2.2?
>                     01/24/2002
>
>                     12:41 PM
>
>                     Please respond
>
>                     to
>
>                     shane_curcuru
>
>
>
>
>
>
>
>
>
> Two questions:
> - Could you be re-using the same Transformer object (or derivative)
> across multiple threads?  Transformers are not threadsafe - only
> Templates objects are.
>
> - You need to re-send the TestXalan.java program either as an
> attachment or inline, since that 3rd attachment doesn't seem to have
> made it to the list.
>
> - Shane
>
> =====
> <eof aka="mailto:[EMAIL PROTECTED]"
>  "http://www.otnemem.com/"=.sig />
>
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions!
> http://auctions.yahoo.com
>
>
>




Reply via email to