axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: [axis2] Concurrency issues
Date Wed, 23 Jan 2008 09:52:56 GMT
Thanks for the answer.
1) Yes, the stubs should be stateless. But the stubs internally access
the Context/Config objects and I was thinking about the reuse of the
Context object by several concurrent invocations.
A test might not necessarily give a correct answer when it comes to
multithreading issues...
2) As was more thinking about the transport layer on the outgoing flow.
If e.g. 2 different stubs are called in parallel, do I risk, that I only
have 1 outgoing HTTP connection?


From: Afkham Azeez [] 
Sent: 22. januar 2008 21:14
Subject: Re: [axis2] Concurrency issues

On Jan 22, 2008 4:07 PM, <> wrote:

	I have a couple of questions regarding Axis2.
	1) Are wdsl2java generated stubs with XMLBeans data binding
	i.e. can the stub be re-used in a concurrent environment?
	In other words, would the following be "reasonable sane" code
	ConfigurationContext context =
	SomeServiceStub stub = new SomeServiceStub(context , someUrl);
	SomeServiceResponseDocument response1;
	SomeServiceResponseDocument response2:
	new Thread(new Runnable() {
	 public void run() {
	   response1 = stub.SomeService(aReqDoc1);
	new Thread(new Runnable() {
	 public void run() {
	   response2 = stub.SomeService(aReqDoc2);
	(And yes I know that there is an asynch facility with callback
in Axis,
	the above was just to illustrate my question)

AFAIK, the stubs are stateless. Hence you should be able to reuse the
stub instances. You could write a test that exercises the section in
your code that starts two thread over several thousand iterations. You
could provide 2 different requests, and compare the responses against
the expected response (provided that the response should be different)

	2) When calling more than 1 stub (not necessarily the same stub
	instance) in parallel, will the transport requests also be in
	Is there a difference here between the synch and asych case?

Yes, the transport requests should be in parallel. Otherwise the system
is going to be very poor in performance.

	To unsubscribe, e-mail:
	For additional commands, e-mail:

Afkham Azeez
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760 

View raw message