Hi,

yes, create one instance of XMLContext only (setup period), and then use
the create(Un)Marshaller() methods to create (Un)Marshaller instances as
needed. In addition, have a look at the reference guide, especially at
the section about performance tuning (best practise).

Regards
Werner

picje wrote:
> Hello,
> 
> I'm using castorl-1.3-xml and I would like to know what is the best approach
> to increase the performance. In fact for Marshalling/Unmarshalling I use
> this kind of code : 
> 
>             
> public RgSearchOutput1 parseRgSearchOutputControlXml(Reader xmlReader)
> throws Exception {
>         RgSearchOutput1 rgSearchOutput1 = null;
>         try{  
>             Mapping mapping = new Mapping();
>             mapping.loadMapping(getRgSearchOutputXmlMapping());
>             
>               XMLContext context = new XMLContext();
>                       context.addMapping(mapping);
>                       
>               Unmarshaller unmarshaller = context.createUnmarshaller();
>                       unmarshaller.setValidation(false);
>                       unmarshaller.setClass(RgSearchOutput1.class);
>                       
>               rgSearchOutput1 =
> (RgSearchOutput1)unmarshaller.unmarshal(xmlReader);
>                       
>           
>         }catch (Exception e){
>             throw e;
>         }
> 
>         return rgSearchOutput1;
> }    
> My question is : Do I have to put in cache the instance of "XMLContext" to
> improve the performance ? What is the best approach when we are in a
> Multithread environment?
> 
> Thanks for your help.
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to