Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
527 views
in Technique[技术] by (71.8m points)

java - Are Axis2 generated stubs thread-safe?

Are client stubs generated from WSDL by Axis2 thread-safe?

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?

You may also wish to use the terminology described here (and originating here) to discuss this more precisely.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

Using apache commons-pooling to pool the instances and using each one from one thread at a time worked well though.

Update: For Axis2, see https://issues.apache.org/jira/browse/AXIS2-4357 (claims Axis2 is not threadsafe, by design)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...