AFAIK this was a conscious design decision. We do not do any locking or synchronization in the stub and it is the responsibility of the of the person who uses the stub to implement thread safety in whatever way that he thinks is appropriate. Hence, one way you may design your solution is to write a client class that wraps an Axis2 client stub & synchronize the relevant places in the code within that client class. This is quite similar to the difference between Hashtable & HashMaps. The developer can optimize the code for better performance if he takes care of making the code thread safe.
Creating a stub is not a very expensive operation provided that you reuse the ConfigurationContext created once. You may also come up with a pooling solution. Hence there is quite a lot of flexibility & you could optimize your code for performance as you wish. HTH Azeez On Wed, Dec 10, 2008 at 6:54 AM, Shehan Simen <[email protected]> wrote: > Yes, I am expecting an answer from someone who develop the axis2. It is > very inefficient to create a stub for each call. > > > > Regards, > > Shehan > > > > *From:* Paul French [mailto:[email protected]] > *Sent:* 2008-12-10 03:29 > *To:* [email protected]; 'David Ojeda' > *Subject:* RE: thread safe axis2 client stub > > > > > http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results > > > > > ------------------------------ > > *From:* David Ojeda [mailto:[email protected]] > *Sent:* 09 December 2008 16:16 > *To:* [email protected] > *Subject:* Re: thread safe axis2 client stub > > I am also interested in this matter. I would like to hear Deepal's opinion, > since he was the one who said that it is not thread safe. > > Paul: > > You said: > > > The link below suggests some tricks you can do to make things more > > > efficient. What are these tricks? > > What link? > > Cheers, > > David > > On Tuesday 09 December 2008 11:50:31 Paul French wrote: > > > This seems strange to me that the client stub cannot be made thread safe. > > > > > > After reading the below I have changed my client service to create the > > > client stub on each call to one of my service methods since the client > stub > > > is not thread safe. > > > > > > I have no idea how inefficient this is? I have noticed that every time I > > > create the client stub (for each and every call) I get the message: > > > > > > `[INFO] Deploying module: metadataExchange - > > > file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar > > > > > > It suggests a lot of work is going on to simply service a single web > > > service call. > > > > > > The link below suggests some tricks you can do to make things more > > > efficient. What are these tricks? > > > > > > Thanks > > > Paul > > > > > > _____ > > > > > > From: Amila Suriarachchi [mailto:[email protected]] > > > Sent: 09 December 2008 04:26 > > > To: [email protected] > > > Subject: Re: thread safe axis2 client stub > > > > > > > > > I was not aware of this. If the axis2 design not permits this it is > better > > > not to use it. > > > > > > thanks, > > > Amila. > > > > > > > > > On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen <[email protected]> > wrote: > > > > > > > > > Also this link: > > > > > > > http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20 > > >t hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results > > > > > > > > > > > > > > > > > > From: Amila Suriarachchi [mailto:[email protected]] > > > Sent: 2008-12-08 15:26 > > > > > > > > > To: [email protected] > > > Subject: Re: thread safe axis2 client stub > > > > > > > > > > > > > > > > > > I have tested with Axis2 1.4 and it worked fine. can you please send the > > > mail thread you mentioned? > > > > > > thanks, > > > Amila. > > > > > > On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen <[email protected]> > wrote: > > > > > > Hi Amila, > > > > > > Thank you for your response. But I found in some discussion, it is saying > > > that the client stub is not thread safe. Is this problem fixed now? In > > > which version I can find it then? > > > > > > > > > > > > Regards, > > > > > > Shehan > > > > > > > > > > > > From: Amila Suriarachchi [mailto:[email protected]] > > > Sent: 2008-12-08 15:13 > > > To: [email protected] > > > Subject: Re: thread safe axis2 client stub > > > > > > > > > > > > yes > > > > > > thanks, > > > Amila. > > > > > > On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <[email protected]> > wrote: > > > > > > Hi, > > > > > > I am going to invoke a web service via a client stub generated by axis2. > > > > > > I want to have a single instance of the stub across my application. > > > > > > So when I initiate the stub (when I call the constructor), I don't like > to > > > call it again throughout my application. > > > > > > Is it thread safe? > > > > > > > > > > > > Regards, > > > > > > Shehan > > > > > > > > > > > > > > > -- > > > Amila Suriarachchi > > > WSO2 Inc. > > > blog: http://amilachinthaka.blogspot.com/ > > > > > > > > > > > > > > > -- > > > Amila Suriarachchi > > > WSO2 Inc. > > > blog: http://amilachinthaka.blogspot.com/ > > -- > > David Ojeda > > > > __________ NOD32 3677 (20081209) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > -- Thanks Afkham Azeez Blog: http://afkham.org Developer Portal: http://www.wso2.org WSAS Blog: http://wso2wsas.blogspot.com Company: http://wso2.com GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
