Hi:

 I'm trying to optimize my usage of castor (1.1.1 release) in a
multi-threaded application.. since constructing the un/marshaller objects
from scratch is slow, I was hoping to instantiate the Mapping object just
once for the mapping file (i just have a single mapping file), and reuse it
while creating instances of un/marshallers.. 

 the optimization technique mentioned in
http://castor.org/xml-best-practice.html seems to have some thread-safety
issues.. i found posts which mentioned that the classes being used here are
not thread-safe.. 

 I was wondering if Mapping objects are thread-safe, and if i can optimize
things this way:
 
 // in class MyUnmarshallerFactory
 public static Unmarshaller getUnmarshaller(){
     return new Unmarshaller(MyUnmarshallerFactory.mapping); 
     // MyUnmarshallerFactory.mapping is instantiated during bootstrap.. 
 }

many thanks..
AB
-- 
View this message in context: 
http://www.nabble.com/Reusing-Mapping-objects..-tp17738424p17738424.html
Sent from the Castor - User mailing list archive at Nabble.com.


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

    http://xircles.codehaus.org/manage_email


Reply via email to