axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <morten.fr...@nordea.dk>
Subject RE: [axis2] Concurrency issues
Date Wed, 23 Jan 2008 09:52:56 GMT
Hi,
 
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?
 
Regards,
Morten
 
 

________________________________

From: Afkham Azeez [mailto:afkham@gmail.com] 
Sent: 22. januar 2008 21:14
To: axis-user@ws.apache.org
Subject: Re: [axis2] Concurrency issues




On Jan 22, 2008 4:07 PM, <morten.frank@nordea.dk> wrote:


	Hi,
	
	I have a couple of questions regarding Axis2.
	
	====================
	1) Are wdsl2java generated stubs with XMLBeans data binding
thread-safe,
	i.e. can the stub be re-used in a concurrent environment?
	
	In other words, would the following be "reasonable sane" code
:-)
	
	ConfigurationContext context =
	
ConfigurationContextFactory.createBasicConfigurationContext(AXIS2_CONFIG
	URATION);
	SomeServiceStub stub = new SomeServiceStub(context , someUrl);
	SomeServiceResponseDocument response1;
	SomeServiceResponseDocument response2:
	new Thread(new Runnable() {
	 public void run() {
	   response1 = stub.SomeService(aReqDoc1);
	 }
	}).start();
	new Thread(new Runnable() {
	 public void run() {
	   response2 = stub.SomeService(aReqDoc2);
	 }
	}).start();
	
	(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
parallel?
	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.
 



	regards
	Morten
	
	
---------------------------------------------------------------------
	To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
	For additional commands, e-mail: axis-user-help@ws.apache.org
	
	




-- 
Thanks
Afkham Azeez

http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760 

Mime
View raw message