Hi AB, if possible for you I suggest to upgrade to 1.2 release and use XMLContext to create your Marshaller/Unmarshaller instances. We already have updated the xml-best-praktis document in SVN but have not updated the website yet. You may take a look at the new page at:
http://fisheye.codehaus.org/browse/~raw,r=7532/castor/castor/trunk/src/doc/xml-best-practice.xml Having said that the document may be a bit difficult to read in SVN as it is not transformed to html there. Regards Ralf bhosle schrieb: > 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 --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

