Axis2生成的存根是否是线程安全的? [英] Are Axis2 generated stubs thread-safe?
问题描述
通过Axis2线程安全从WSDL生成客户端存根吗?
Are client stubs generated from WSDL by Axis2 thread-safe?
当然,线程安全不是一个严格定义的术语,所以我' m至少对以下内容感兴趣:
Of course, "thread-safe" isn't necessary a rigorously defined term, so I'm at least interested in the following:
同一存根类的不同的实例可由不同的线程同时访问,具有与以下相同的有效行为:单线程执行?
Are different instances of the same stub class accessible concurrently by different threads, with the same effective behavior as single-threaded execution?
同一存根类的单实例是否可由不同的线程同时访问,具有相同的有效行为在单线程执行中以某种任意方式调用交错?
Is a single instance of the same stub class accessible concurrently by different threads, with the same effective behavior as the same calls interleaved in some arbitrary way in single-threaded execution?
您可能还希望使用描述的术语这里(并且发起 here )更准确地讨论这个问题。
You may also wish to use the terminology described here (and originating here) to discuss this more precisely.
推荐答案
我不确定axis2,但至少axis1生成非线程安全的客户端存根。我得到的印象几乎所有其他SOAP客户端也是非线程安全的。如果我没记错的话,问题在于客户端存根以非线程安全的方式使用XML解析库。
I'm not sure about axis2, but at least axis1 generates non-threadsafe client stubs. I got the impression pretty much every other SOAP client was non-threadsafe as well. If I remember correctly the issue was with the XML parsing library being used in a non-threadsafe way by the client stub.
使用apache commons-pooling来汇集实例和虽然每次使用一个线程中的每一个都运行良好。
Using apache commons-pooling to pool the instances and using each one from one thread at a time worked well though.
更新:对于Axis2,请参阅 https://issues.apache.org/jira/browse/AXIS2-4357 (声称Axis2不是线程安全的,按设计)
Update: For Axis2, see https://issues.apache.org/jira/browse/AXIS2-4357 (claims Axis2 is not threadsafe, by design)
这篇关于Axis2生成的存根是否是线程安全的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!