This link below talks about reusing ClassDescriptorResolvers to achieve best
performance.  Is this link suggesting that it is thread-safe?  If so, maybe
this page should be updated.

http://www.castor.org/xml-best-practice.html

Tom 

-----Original Message-----
From: Ralf Joachim [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 2:50 AM
To: [email protected]
Subject: Re: [castor-user] ClassDescriptorResolver & thread safety

Hello Michael,

as far as I can see when looking at the source of XMLClassDescriptorResolver
it isn't thread safe by design. While I think there should be no problem if
all ClassDescriptor's are loaded before starting to un-/marshal, I'd suggest
to go safe and use them in a thread safe way. E.g. one CDR per thread or by
implementing a CDR pool.

Regards
Ralf

Michael Crozier schrieb:
> Hello,
> 
> As outlined in the best practices document, I'm using 
> ClassDescriptorResolver to load and cache mappings.  I understand that 
> Marshaller and Unmarshaller objects are not thread safe, but 
> ClassDescriptorResolver has no mention of thread-safety.  I am using 
> this mechanism to load mappings from String objects and well as from
Files.
> 
> Is it thread-safe to share a single ClassDescriptorResolver instance 
> between many threads, in which new marshalling objects are created
per-invocation?
> 
> Many thanks,
> 
>   Michael
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email

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

    http://xircles.codehaus.org/manage_email

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

    http://xircles.codehaus.org/manage_email

Reply via email to