Hi, I took a look at source code (always in the old 2.2.9 release) starting from a debug session. Cxf code is always a good read :)
I think there is no difference on thread safety of clients in the case MTOM enabled from the case "disabled" because the references to attachments are included in the original request object (the request object which is JAXB annotated) as DataHandlers and not stored in the shared RequestContext. Is this correct? So, referring to http://cxf.apache.org/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%3F I think I can continue to use a single istance of proxy in multi threading environment also if MTOM is enabled. I can also evaluate a change in my code to set the "thread.local.request.context" to "true" in RequestContext but I think it is not necessary. Addictional elements found in source code: The only shared element in RequestContext which may suffer of concurrency is the variable: java.lang.reflect.Method whose value is set in method org.apache.cxf.jaxws.JaxWsClientProxy.invoke(Object, Method, Object[]) from the instruction: client.getRequestContext().put(Method.class.getName(), method); However as I can see the current method instance to be invoked (I have different method to invoke on the same client at runtime) is also passed as parameter in following invocations (perhaps the runtime is not using the method in the context element at all) so perhaps there is not concurrency problem. Thank you. -- View this message in context: http://cxf.547215.n5.nabble.com/Cxf-2-2-9-client-thread-safety-and-MTOM-tp5673119p5675504.html Sent from the cxf-user mailing list archive at Nabble.com.
