You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shehan Simen <ss...@itree.com.au> on 2008/12/08 05:01:15 UTC

thread safe axis2 client stub

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

Re: thread safe axis2 client stub

Posted by Afkham Azeez <af...@gmail.com>.
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 <ss...@itree.com.au> 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:paul.french@kirona.com]
> *Sent:* 2008-12-10 03:29
> *To:* axis-user@ws.apache.org; '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:dojeda-list@integra.la]
> *Sent:* 09 December 2008 16:16
> *To:* axis-user@ws.apache.org
> *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:amilasuriarachchi@gmail.com]
>
> > Sent: 09 December 2008 04:26
>
> > To: axis-user@ws.apache.org
>
> > 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 <ss...@itree.com.au>
> 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:amilasuriarachchi@gmail.com]
>
> > Sent: 2008-12-08 15:26
>
> >
>
> >
>
> > To: axis-user@ws.apache.org
>
> > 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 <ss...@itree.com.au>
> 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:amilasuriarachchi@gmail.com]
>
> > Sent: 2008-12-08 15:13
>
> > To: axis-user@ws.apache.org
>
> > Subject: Re: thread safe axis2 client stub
>
> >
>
> >
>
> >
>
> > yes
>
> >
>
> > thanks,
>
> > Amila.
>
> >
>
> > On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au>
> 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

RE: thread safe axis2 client stub

Posted by Shawn McKinney <sm...@sbcglobal.net>.
We've implemented thread-safe solution by maintaining a commons pool of client stubs.  When a thread needs to access the axis client it simply removes a stub from the pool.  This strategy has worked well for us.


--- On Wed, 12/10/08, Paul French <pa...@kirona.com> wrote:

> From: Paul French <pa...@kirona.com>
> Subject: RE: thread safe axis2 client stub
> To: axis-user@ws.apache.org
> Date: Wednesday, December 10, 2008, 11:13 AM
> Yes that is one solution but that means creating a pool of
> client stub
> objects (much like a database connection pool) or storing a
> client stub in a
> Thread local variable which isn't great if you have a
> lot of threads running
> in your servlet container.
>  
> For a web service call over HTTP fundamentally all you are
> doing is creating
> a connection to a http server writing some text and getting
> a response back
> as text and closing the connection. There is no need to
> share read/write
> state across threads. I cannot see why a client stub cannot
> be made thread
> safe?
>  
> 
> 
>   _____  
> 
> From: Kraus, David [mailto:dkraus@MicroStrategy.com] 
> Sent: 10 December 2008 16:56
> To: axis-user@ws.apache.org
> Subject: RE: thread safe axis2 client stub
> 
> 
> 
> I would think that there is no need to create a new client
> stub for each web
> service call. You just need to be sure you create a
> separate stub for each
> client thread. On each thread you can make as many web
> service calls as you
> like using the same proxy.
> 
>  
> 
>   _____  
> 
> From: Paul French [mailto:paul.french@kirona.com] 
> Sent: Wednesday, December 10, 2008 4:37 AM
> To: axis-user@ws.apache.org
> Subject: RE: thread safe axis2 client stub
> 
>  
> 
> Can anyone comment on this? It is a major issue for us.
> 
>  
> 
> Why is the client stub created not thread safe?
> 
>  
> 
> If it cannot be made thread safe then how can you avoid the
> huge overhead of
> instantiating a new client stub per web service call?
> 
>  
> 
>   _____  
> 
> From: Shehan Simen [mailto:ssimen@itree.com.au] 
> Sent: 10 December 2008 01:24
> To: axis-user@ws.apache.org
> Subject: RE: thread safe axis2 client stub
> 
> 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:paul.french@kirona.com] 
> Sent: 2008-12-10 03:29
> To: axis-user@ws.apache.org; 'David Ojeda'
> Subject: RE: thread safe axis2 client stub
> 
>  
> 
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
> hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
> 
>  
> 
>  
> 
>   _____  
> 
> From: David Ojeda [mailto:dojeda-list@integra.la] 
> Sent: 09 December 2008 16:16
> To: axis-user@ws.apache.org
> 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:amilasuriarachchi@gmail.com]
> 
> > Sent: 09 December 2008 04:26
> 
> > To: axis-user@ws.apache.org
> 
> > 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
> <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> 
> > Sent: 2008-12-08 15:26
> 
> > 
> 
> > 
> 
> > To: axis-user@ws.apache.org
> 
> > 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
> <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> 
> > Sent: 2008-12-08 15:13
> 
> > To: axis-user@ws.apache.org
> 
> > Subject: Re: thread safe axis2 client stub
> 
> > 
> 
> > 
> 
> > 
> 
> > yes
> 
> > 
> 
> > thanks,
> 
> > Amila.
> 
> > 
> 
> > On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen
> <ss...@itree.com.au> 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
> 
> 
> 
> __________ NOD32 3680 (20081210) Information __________
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> 
> 
> 
> __________ NOD32 3682 (20081210) Information __________
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com

RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
Yes that is one solution but that means creating a pool of client stub
objects (much like a database connection pool) or storing a client stub in a
Thread local variable which isn't great if you have a lot of threads running
in your servlet container.
 
For a web service call over HTTP fundamentally all you are doing is creating
a connection to a http server writing some text and getting a response back
as text and closing the connection. There is no need to share read/write
state across threads. I cannot see why a client stub cannot be made thread
safe?
 


  _____  

From: Kraus, David [mailto:dkraus@MicroStrategy.com] 
Sent: 10 December 2008 16:56
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub



I would think that there is no need to create a new client stub for each web
service call. You just need to be sure you create a separate stub for each
client thread. On each thread you can make as many web service calls as you
like using the same proxy.

 

  _____  

From: Paul French [mailto:paul.french@kirona.com] 
Sent: Wednesday, December 10, 2008 4:37 AM
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub

 

Can anyone comment on this? It is a major issue for us.

 

Why is the client stub created not thread safe?

 

If it cannot be made thread safe then how can you avoid the huge overhead of
instantiating a new client stub per web service call?

 

  _____  

From: Shehan Simen [mailto:ssimen@itree.com.au] 
Sent: 10 December 2008 01:24
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub

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:paul.french@kirona.com] 
Sent: 2008-12-10 03:29
To: axis-user@ws.apache.org; 'David Ojeda'
Subject: RE: thread safe axis2 client stub

 

http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results

 

 

  _____  

From: David Ojeda [mailto:dojeda-list@integra.la] 
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

> 

> 

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

> 

> 

> 

> yes

> 

> thanks,

> Amila.

> 

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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



__________ NOD32 3680 (20081210) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



__________ NOD32 3682 (20081210) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


RE: thread safe axis2 client stub

Posted by "Kraus, David" <dk...@MicroStrategy.com>.
I would think that there is no need to create a new client stub for each
web service call. You just need to be sure you create a separate stub
for each client thread. On each thread you can make as many web service
calls as you like using the same proxy.

 

________________________________

From: Paul French [mailto:paul.french@kirona.com] 
Sent: Wednesday, December 10, 2008 4:37 AM
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub

 

Can anyone comment on this? It is a major issue for us.

 

Why is the client stub created not thread safe?

 

If it cannot be made thread safe then how can you avoid the huge
overhead of instantiating a new client stub per web service call?

 

________________________________

From: Shehan Simen [mailto:ssimen@itree.com.au] 
Sent: 10 December 2008 01:24
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub

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:paul.french@kirona.com] 
Sent: 2008-12-10 03:29
To: axis-user@ws.apache.org; '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:dojeda-list@integra.la] 
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au>
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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

> 

> 

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au>
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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

> 

> 

> 

> yes

> 

> thanks,

> Amila.

> 

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au>
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



__________ NOD32 3680 (20081210) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
Can anyone comment on this? It is a major issue for us.
 
Why is the client stub created not thread safe?
 
If it cannot be made thread safe then how can you avoid the huge overhead of
instantiating a new client stub per web service call?

  _____  

From: Shehan Simen [mailto:ssimen@itree.com.au] 
Sent: 10 December 2008 01:24
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub



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:paul.french@kirona.com] 
Sent: 2008-12-10 03:29
To: axis-user@ws.apache.org; 'David Ojeda'
Subject: RE: thread safe axis2 client stub

 

http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results

 

 

  _____  

From: David Ojeda [mailto:dojeda-list@integra.la] 
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

> 

> 

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

> 

> 

> 

> yes

> 

> thanks,

> Amila.

> 

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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



__________ NOD32 3680 (20081210) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
I would have thought making the client stub thread safe would be the
superior solution.
 
If this cannot be done then I would opt for the pooling solution.
 
Out of interest is this a general problem due a specific API that axis2 has
implemented or is it an axis2 design problem?
 
Is there another web service stack out there that can create thread safe
clients?
 
Thanks

  _____  

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: 15 December 2008 02:01
To: paul.french@kirona.com
Subject: RE: thread safe axis2 client stub


If you have a ThreadedPool approach for client stub you can submit the code
to axis-dev

As the majority of implementations I've seen are single desktop and or
browserclient
as the majority of clients start in public static main(String args)
and refactor the the service code to a 'thread-safe'  client 

I would start by changing the command line parameters at
org.apache.axis2.wsdl.WSDL2Code.java

the annotations are handled at
org.apache.axis2.wsdl.codegen.emitter.jaxws.AnnotationElementBuilder
static Element buildWebServiceClientAnnotationElement(String name, String
targetNS, String wsdlLocation,Document doc) 
(notice the static signature)so  I would try to change this

but the real heart of the client stub writer sits at
org.apache.axis2.wsdl.codegen.emitter
public class CEmitter extends AxisServiceBasedMultiLanguageEmitter
specifically writeFile e.g.
 /*** Writes the Stub.** @throws Exception */
    protected void writeCStub() throws Exception 
   {
        // first check for the policies in this service and write them
        Document interfaceImplModel =
createDOMDocumentForInterfaceImplementation();

        CStubHeaderWriter writerHStub =
                new
CStubHeaderWriter(getOutputDirectory(codeGenConfiguration.getOutputLocation(
),
 
codeGenConfiguration.getSourceLocation()),
 
codeGenConfiguration.getOutputLanguage());

        writeFile(interfaceImplModel, writerHStub);
                    

        CStubSourceWriter writerCStub =
                new
CStubSourceWriter(getOutputDirectory(codeGenConfiguration.getOutputLocation(
),
 
codeGenConfiguration.getSourceLocation()),
 
codeGenConfiguration.getOutputLanguage());

        writeFile(interfaceImplModel, writerCStub);
    }

//and the final writer code is in AxisServiceBasedMultiLanguageEmitter
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter
    /**
     * A resusable method for the implementation of interface and
implementation writing.
     * @param model
     * @param writer
     * @throws java.io.IOException
     * @throws Exception
     */
    protected void writeFile(Document model, FileWriter writer) throws
IOException, Exception 
   {
        writer.loadTemplate();

        String packageName =
model.getDocumentElement().getAttribute("package");
        String className = model.getDocumentElement().getAttribute("name");

        writer.createOutFile(packageName, className);

        // use the global resolver

        //at this point you will want to make sure the statics are now class
are now objects plenty of logging will be helpful
        writer.parse(model, resolver);
    }

HTH
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and Sender
does not endorse distribution to any party other than intended recipient.
Sender does not necessarily endorse content contained within this
transmission. 





  _____  

From: paul.french@kirona.com
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub
Date: Sun, 14 Dec 2008 21:35:05 +0000


Bump! Anyone?
 
If Axis2 is to be performant then can someone from the Axis2 development
team explain the best way to call a web service using Axis2 client stubs? We
have a web application where a user interaction initiates a web service
call. Are we expected to store one client stub per thread in a thread local
or create a pool of client stubs?
 
I would also like to know why a client stub is not thread safe?
 
Thanks.

  _____  

From: Paul French [mailto:paul.french@kirona.com] 
Sent: 10 December 2008 12:37
To: 'axis-user@ws.apache.org'
Subject: RE: thread safe axis2 client stub


Can anyone comment on this? It is a major issue for us.
 
Why is the client stub created not thread safe?
 
If it cannot be made thread safe then how can you avoid the huge overhead of
instantiating a new client stub per web service call?

  _____  

From: Shehan Simen [mailto:ssimen@itree.com.au] 
Sent: 10 December 2008 01:24
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub



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:paul.french@kirona.com] 
Sent: 2008-12-10 03:29
To: axis-user@ws.apache.org; 'David Ojeda'
Subject: RE: thread safe axis2 client stub

 

http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results

 

 

  _____  

From: David Ojeda [mailto:dojeda-list@integra.la] 
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

> 

> 

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

> 

> 

> 

> yes

> 

> thanks,

> Amila.

> 

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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



__________ NOD32 3680 (20081210) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


  _____  

Send e-mail anywhere. No map, no compass. Get your Hotmail
<http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhe
re_122008> R account now. 

RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
Bump! Anyone?
 
If Axis2 is to be performant then can someone from the Axis2 development
team explain the best way to call a web service using Axis2 client stubs? We
have a web application where a user interaction initiates a web service
call. Are we expected to store one client stub per thread in a thread local
or create a pool of client stubs?
 
I would also like to know why a client stub is not thread safe?
 
Thanks.

  _____  

From: Paul French [mailto:paul.french@kirona.com] 
Sent: 10 December 2008 12:37
To: 'axis-user@ws.apache.org'
Subject: RE: thread safe axis2 client stub


Can anyone comment on this? It is a major issue for us.
 
Why is the client stub created not thread safe?
 
If it cannot be made thread safe then how can you avoid the huge overhead of
instantiating a new client stub per web service call?

  _____  

From: Shehan Simen [mailto:ssimen@itree.com.au] 
Sent: 10 December 2008 01:24
To: axis-user@ws.apache.org
Subject: RE: thread safe axis2 client stub



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:paul.french@kirona.com] 
Sent: 2008-12-10 03:29
To: axis-user@ws.apache.org; 'David Ojeda'
Subject: RE: thread safe axis2 client stub

 

http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results

 

 

  _____  

From: David Ojeda [mailto:dojeda-list@integra.la] 
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

> 

> 

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

> 

> 

> 

> yes

> 

> thanks,

> Amila.

> 

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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



__________ NOD32 3680 (20081210) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


RE: thread safe axis2 client stub

Posted by Shehan Simen <ss...@itree.com.au>.
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:paul.french@kirona.com]
Sent: 2008-12-10 03:29
To: axis-user@ws.apache.org; '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:dojeda-list@integra.la]
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

>

>

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

>

>

>

> yes

>

> thanks,

> Amila.

>

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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

RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
 

  _____  

From: David Ojeda [mailto:dojeda-list@integra.la] 
Sent: 09 December 2008 16:16
To: axis-user@ws.apache.org
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:amilasuriarachchi@gmail.com]

> Sent: 09 December 2008 04:26

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:26

>

>

> To: axis-user@ws.apache.org

> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]

> Sent: 2008-12-08 15:13

> To: axis-user@ws.apache.org

> Subject: Re: thread safe axis2 client stub

>

>

>

> yes

>

> thanks,

> Amila.

>

> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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


Re: thread safe axis2 client stub

Posted by David Ojeda <do...@integra.la>.
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:amilasuriarachchi@gmail.com]
> Sent: 09 December 2008 04:26
> To: axis-user@ws.apache.org
> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> Sent: 2008-12-08 15:26
>
>
> To: axis-user@ws.apache.org
> 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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> Sent: 2008-12-08 15:13
> To: axis-user@ws.apache.org
> Subject: Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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


Re: thread safe axis2 client stub

Posted by Amila Suriarachchi <am...@gmail.com>.
On Mon, Dec 22, 2008 at 2:14 AM, Deepal Jayasinghe <de...@opensource.lk>wrote:

>
> >
> > We used the commons pooling approach in the end but only creating one
> > ConfigurationContext. This seems to work well. The only thing that
> worries
> > me now is Deepals last comment. Any insight into this?
> >
> Well cleaning up the transports is good in every cases, specially when
> you use the case configuration context and if you try to invoke
> considerable amount of service call. Then you will get some exception
> due to open client sockets. So to clean them service client has an API.
>
> If you do not have any problem with what you are doing, then you do not
> need to worry about the transport cleanup, but in a long run you might
> need to clean the transports.


hi Deepal,
Do you know the exact reason for not been  thread safe?

The generated stub class operations cleans up the transport at the finally
block.

            } finally {

_messageContext.getTransportOut().getSender().cleanup(_messageContext);
            }

The only state variable _serviceClient which keeps a serviceContext object.
As a result of this every operation Client uses same serviceContext Object.
But this won't make any problem unless you use different options for
different operation invocations.
This can be avoided by creating new stub objects per operation using the
same configuration context object.

As I know axis2 works in a state less manner. It uses some thread safe
tables to keep dispatching and callback information. Unless some one using
some stateful invocations (using different scope other than request) it
should work in thread safe manner.

thanks,
Amila.


>
> Deepal
> > Merry Xmas.
> >
> > -----Original Message-----
> > From: Deepal jayasinghe [mailto:deepalk@gmail.com]
> > Sent: 21 December 2008 15:00
> > To: axis-user@ws.apache.org
> > Subject: Re: thread safe axis2 client stub
> >
> > Yes, creating ConfigurationContext is very expensive since it involve
> > reading various files. So as Thilina mentioned create a
> ConfigurationContext
> > and use the created ConfigurationContext for subsequent call. Simply when
> > you create the stub pass the same configuration context.
> >
> > However when you use this approach, do not forget to cleanup the
> transport.
> > You can do that by getting the service client from the stub, and calling
> its
> > cleanup transport method.
> >
> > Deepal
> >
> >> AFAIK creating a stub is not expensive, but creating the
> >> AxisConfiguration & ConfigurationContext is very expensive. You can
> >> create one AxisConfiguration & ConfigurationContext and share it
> >> across any number of clients. No need to create them per thread basis..
> >>
> >> thanks,
> >> Thilina
> >>
> >> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen <ssimen@itree.com.au
> >> <ma...@itree.com.au>> wrote:
> >>
> >>     Hi Samera,
> >>
> >>     So do we have to create a ConfigurationContext for each thread?
> >>     Is'nt it too much for each thread?
> >>
> >>
> >>
> >>     Regards,
> >>
> >>     Shehan
> >>
> >>
> >>
> >>     *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com
> >>     <ma...@gmail.com>]
> >>     *Sent:* 2008-12-15 15:06
> >>
> >>     *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
> >>     *Subject:* Re: thread safe axis2 client stub
> >>
> >>
> >>
> >>
> >>
> >>     On Tue, Dec 9, 2008 at 9:50 PM, Paul French
> >>     <paul.french@kirona.com <ma...@kirona.com>> 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.
> >>
> >>
> >>     you get the above message, when creating a new
> >>     ConfigurationContext instance. Creating a CC instance is a heavy
> >>     operation, therefore you can instantiate a CC instance once and
> >>     use it for all subsequent calls.
> >>
> >>     Sameera
> >>
> >>
> >>
> >>
> >>         The link below suggests some tricks you can do to make things
> >>         more efficient. What are these tricks?
> >>
> >>
> >>
> >>         Thanks
> >>
> >>         Paul
> >>
> >>
> >>
> >>
> >> ----------------------------------------------------------------------
> >> --
> >>
> >>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
> >>         <ma...@gmail.com>]
> >>
> >>         *Sent:* 09 December 2008 04:26
> >>
> >>
> >>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
> >>         *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
> >>         <ssimen@itree.com.au <ma...@itree.com.au>> wrote:
> >>
> >>         Also this link:
> >>
> >>
> >> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20st
> >> ub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
> >>
> >>
> >>
> >>
> >>
> >>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
> >>         <ma...@gmail.com>]
> >>         *Sent:* 2008-12-08 15:26
> >>
> >>
> >>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
> >>         *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
> >>         <ssimen@itree.com.au <ma...@itree.com.au>> 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:amilasuriarachchi@gmail.com
> >>         <ma...@gmail.com>]
> >>         *Sent:* 2008-12-08 15:13
> >>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
> >>         *Subject:* Re: thread safe axis2 client stub
> >>
> >>
> >>
> >>         yes
> >>
> >>         thanks,
> >>         Amila.
> >>
> >>         On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen
> >>         <ssimen@itree.com.au <ma...@itree.com.au>> 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/
> >>
> >>
> >>
> >>
> >>         --
> >>         Amila Suriarachchi
> >>         WSO2 Inc.
> >>         blog: http://amilachinthaka.blogspot.com/
> >>
> >>
> >>
> >>
> >>     --
> >>     Sameera
> >>     http://sameera-jayasoma.blogspot.com/
> >>     http://www.flickr.com/photos/sameera-jayasoma
> >>
> >>
> >>
> >>
> >> --
> >> Thilina Gunarathne  - http://thilinag.blogspot.com
> >>
> >
> >
> >
>
> --
> Thank you!
>
>
> http://blogs.deepal.org
> http://deepal.org
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: thread safe axis2 client stub

Posted by Deepal Jayasinghe <de...@opensource.lk>.
>
> We used the commons pooling approach in the end but only creating one
> ConfigurationContext. This seems to work well. The only thing that worries
> me now is Deepals last comment. Any insight into this?
>   
Well cleaning up the transports is good in every cases, specially when
you use the case configuration context and if you try to invoke
considerable amount of service call. Then you will get some exception
due to open client sockets. So to clean them service client has an API.

If you do not have any problem with what you are doing, then you do not
need to worry about the transport cleanup, but in a long run you might
need to clean the transports.

Deepal
> Merry Xmas.
>
> -----Original Message-----
> From: Deepal jayasinghe [mailto:deepalk@gmail.com] 
> Sent: 21 December 2008 15:00
> To: axis-user@ws.apache.org
> Subject: Re: thread safe axis2 client stub
>
> Yes, creating ConfigurationContext is very expensive since it involve
> reading various files. So as Thilina mentioned create a ConfigurationContext
> and use the created ConfigurationContext for subsequent call. Simply when
> you create the stub pass the same configuration context.
>
> However when you use this approach, do not forget to cleanup the transport.
> You can do that by getting the service client from the stub, and calling its
> cleanup transport method.
>
> Deepal
>   
>> AFAIK creating a stub is not expensive, but creating the 
>> AxisConfiguration & ConfigurationContext is very expensive. You can 
>> create one AxisConfiguration & ConfigurationContext and share it 
>> across any number of clients. No need to create them per thread basis..
>>
>> thanks,
>> Thilina
>>
>> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen <ssimen@itree.com.au 
>> <ma...@itree.com.au>> wrote:
>>
>>     Hi Samera,
>>
>>     So do we have to create a ConfigurationContext for each thread?
>>     Is'nt it too much for each thread?
>>
>>      
>>
>>     Regards,
>>
>>     Shehan
>>
>>      
>>
>>     *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com
>>     <ma...@gmail.com>]
>>     *Sent:* 2008-12-15 15:06
>>
>>     *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>>     *Subject:* Re: thread safe axis2 client stub
>>
>>      
>>
>>      
>>
>>     On Tue, Dec 9, 2008 at 9:50 PM, Paul French
>>     <paul.french@kirona.com <ma...@kirona.com>> 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.
>>
>>
>>     you get the above message, when creating a new
>>     ConfigurationContext instance. Creating a CC instance is a heavy
>>     operation, therefore you can instantiate a CC instance once and
>>     use it for all subsequent calls.
>>
>>     Sameera
>>      
>>
>>          
>>
>>         The link below suggests some tricks you can do to make things
>>         more efficient. What are these tricks?
>>
>>          
>>
>>         Thanks
>>
>>         Paul
>>
>>          
>>
>>         
>> ----------------------------------------------------------------------
>> --
>>
>>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
>>         <ma...@gmail.com>]
>>
>>         *Sent:* 09 December 2008 04:26
>>
>>
>>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>>         *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
>>         <ssimen@itree.com.au <ma...@itree.com.au>> wrote:
>>
>>         Also this link:
>>
>>         
>> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20st
>> ub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>>
>>          
>>
>>          
>>
>>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
>>         <ma...@gmail.com>]
>>         *Sent:* 2008-12-08 15:26
>>
>>
>>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>>         *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
>>         <ssimen@itree.com.au <ma...@itree.com.au>> 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:amilasuriarachchi@gmail.com
>>         <ma...@gmail.com>]
>>         *Sent:* 2008-12-08 15:13
>>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>>         *Subject:* Re: thread safe axis2 client stub
>>
>>          
>>
>>         yes
>>
>>         thanks,
>>         Amila.
>>
>>         On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen
>>         <ssimen@itree.com.au <ma...@itree.com.au>> 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/
>>
>>
>>
>>
>>         -- 
>>         Amila Suriarachchi
>>         WSO2 Inc.
>>         blog: http://amilachinthaka.blogspot.com/
>>
>>
>>
>>
>>     -- 
>>     Sameera
>>     http://sameera-jayasoma.blogspot.com/
>>     http://www.flickr.com/photos/sameera-jayasoma
>>
>>
>>
>>
>> --
>> Thilina Gunarathne  - http://thilinag.blogspot.com
>>     
>
>
>   

-- 
Thank you!


http://blogs.deepal.org
http://deepal.org


RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
Say I create a single client stub, I have not seen it mentioned that you
need to cleanup the transport after you are done with the client stub? Hence
why do you need to do it in the below case?

By the way, I do appreciate all the comments made so far on this issue. My
understanding has increased due to your comments.

We used the commons pooling approach in the end but only creating one
ConfigurationContext. This seems to work well. The only thing that worries
me now is Deepals last comment. Any insight into this?

Merry Xmas.

-----Original Message-----
From: Deepal jayasinghe [mailto:deepalk@gmail.com] 
Sent: 21 December 2008 15:00
To: axis-user@ws.apache.org
Subject: Re: thread safe axis2 client stub

Yes, creating ConfigurationContext is very expensive since it involve
reading various files. So as Thilina mentioned create a ConfigurationContext
and use the created ConfigurationContext for subsequent call. Simply when
you create the stub pass the same configuration context.

However when you use this approach, do not forget to cleanup the transport.
You can do that by getting the service client from the stub, and calling its
cleanup transport method.

Deepal
> AFAIK creating a stub is not expensive, but creating the 
> AxisConfiguration & ConfigurationContext is very expensive. You can 
> create one AxisConfiguration & ConfigurationContext and share it 
> across any number of clients. No need to create them per thread basis..
>
> thanks,
> Thilina
>
> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen <ssimen@itree.com.au 
> <ma...@itree.com.au>> wrote:
>
>     Hi Samera,
>
>     So do we have to create a ConfigurationContext for each thread?
>     Is'nt it too much for each thread?
>
>      
>
>     Regards,
>
>     Shehan
>
>      
>
>     *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com
>     <ma...@gmail.com>]
>     *Sent:* 2008-12-15 15:06
>
>     *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>     *Subject:* Re: thread safe axis2 client stub
>
>      
>
>      
>
>     On Tue, Dec 9, 2008 at 9:50 PM, Paul French
>     <paul.french@kirona.com <ma...@kirona.com>> 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.
>
>
>     you get the above message, when creating a new
>     ConfigurationContext instance. Creating a CC instance is a heavy
>     operation, therefore you can instantiate a CC instance once and
>     use it for all subsequent calls.
>
>     Sameera
>      
>
>          
>
>         The link below suggests some tricks you can do to make things
>         more efficient. What are these tricks?
>
>          
>
>         Thanks
>
>         Paul
>
>          
>
>         
> ----------------------------------------------------------------------
> --
>
>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
>         <ma...@gmail.com>]
>
>         *Sent:* 09 December 2008 04:26
>
>
>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>         *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
>         <ssimen@itree.com.au <ma...@itree.com.au>> wrote:
>
>         Also this link:
>
>         
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20st
> ub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>          
>
>          
>
>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
>         <ma...@gmail.com>]
>         *Sent:* 2008-12-08 15:26
>
>
>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>         *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
>         <ssimen@itree.com.au <ma...@itree.com.au>> 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:amilasuriarachchi@gmail.com
>         <ma...@gmail.com>]
>         *Sent:* 2008-12-08 15:13
>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>         *Subject:* Re: thread safe axis2 client stub
>
>          
>
>         yes
>
>         thanks,
>         Amila.
>
>         On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen
>         <ssimen@itree.com.au <ma...@itree.com.au>> 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/
>
>
>
>
>         -- 
>         Amila Suriarachchi
>         WSO2 Inc.
>         blog: http://amilachinthaka.blogspot.com/
>
>
>
>
>     -- 
>     Sameera
>     http://sameera-jayasoma.blogspot.com/
>     http://www.flickr.com/photos/sameera-jayasoma
>
>
>
>
> --
> Thilina Gunarathne  - http://thilinag.blogspot.com


-- 
Thank you!


http://blogs.deepal.org
http://deepal.org



__________ NOD32 3709 (20081220) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



Re: thread safe axis2 client stub

Posted by Deepal jayasinghe <de...@gmail.com>.
Yes, creating ConfigurationContext is very expensive since it involve
reading various files. So as Thilina mentioned create a
ConfigurationContext and use the created ConfigurationContext for
subsequent call. Simply when you create the stub pass the same
configuration context.

However when you use this approach, do not forget to cleanup the
transport. You can do that by getting the service client from the stub,
and calling its cleanup transport method.

Deepal
> AFAIK creating a stub is not expensive, but creating the
> AxisConfiguration & ConfigurationContext is very expensive. You can
> create one AxisConfiguration & ConfigurationContext and share it
> across any number of clients. No need to create them per thread basis..
>
> thanks,
> Thilina
>
> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen <ssimen@itree.com.au
> <ma...@itree.com.au>> wrote:
>
>     Hi Samera,
>
>     So do we have to create a ConfigurationContext for each thread?
>     Is'nt it too much for each thread?
>
>      
>
>     Regards,
>
>     Shehan
>
>      
>
>     *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com
>     <ma...@gmail.com>]
>     *Sent:* 2008-12-15 15:06
>
>     *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>     *Subject:* Re: thread safe axis2 client stub
>
>      
>
>      
>
>     On Tue, Dec 9, 2008 at 9:50 PM, Paul French
>     <paul.french@kirona.com <ma...@kirona.com>> 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.
>
>
>     you get the above message, when creating a new
>     ConfigurationContext instance. Creating a CC instance is a heavy
>     operation, therefore you can instantiate a CC instance once and
>     use it for all subsequent calls.
>
>     Sameera
>      
>
>          
>
>         The link below suggests some tricks you can do to make things
>         more efficient. What are these tricks?
>
>          
>
>         Thanks
>
>         Paul
>
>          
>
>         ------------------------------------------------------------------------
>
>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
>         <ma...@gmail.com>]
>
>         *Sent:* 09 December 2008 04:26
>
>
>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>         *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
>         <ssimen@itree.com.au <ma...@itree.com.au>> wrote:
>
>         Also this link:
>
>         http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>          
>
>          
>
>         *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com
>         <ma...@gmail.com>]
>         *Sent:* 2008-12-08 15:26
>
>
>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>         *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
>         <ssimen@itree.com.au <ma...@itree.com.au>> 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:amilasuriarachchi@gmail.com
>         <ma...@gmail.com>]
>         *Sent:* 2008-12-08 15:13
>         *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>         *Subject:* Re: thread safe axis2 client stub
>
>          
>
>         yes
>
>         thanks,
>         Amila.
>
>         On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen
>         <ssimen@itree.com.au <ma...@itree.com.au>> 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/
>
>
>
>
>         -- 
>         Amila Suriarachchi
>         WSO2 Inc.
>         blog: http://amilachinthaka.blogspot.com/
>
>
>
>
>     -- 
>     Sameera
>     http://sameera-jayasoma.blogspot.com/
>     http://www.flickr.com/photos/sameera-jayasoma
>
>
>
>
> -- 
> Thilina Gunarathne  - http://thilinag.blogspot.com


-- 
Thank you!


http://blogs.deepal.org
http://deepal.org



Re: thread safe axis2 client stub

Posted by Thilina Gunarathne <cs...@gmail.com>.
AFAIK creating a stub is not expensive, but creating the AxisConfiguration &
ConfigurationContext is very expensive. You can create one AxisConfiguration
& ConfigurationContext and share it across any number of clients. No need to
create them per thread basis..

thanks,
Thilina

On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen <ss...@itree.com.au> wrote:

>  Hi Samera,
>
> So do we have to create a ConfigurationContext for each thread? Is'nt it
> too much for each thread?
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com]
> *Sent:* 2008-12-15 15:06
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
>
>
> On Tue, Dec 9, 2008 at 9:50 PM, Paul French <pa...@kirona.com>
> 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.
>
>
> you get the above message, when creating a new ConfigurationContext
> instance. Creating a CC instance is a heavy operation, therefore you can
> instantiate a CC instance once and use it for all subsequent calls.
>
> Sameera
>
>
>
>
> The link below suggests some tricks you can do to make things more
> efficient. What are these tricks?
>
>
>
> Thanks
>
> Paul
>
>
>  ------------------------------
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
>
> *Sent:* 09 December 2008 04:26
>
>
> *To:* axis-user@ws.apache.org
> *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 <ss...@itree.com.au> wrote:
>
> Also this link:
>
>
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:26
>
>
> *To:* axis-user@ws.apache.org
> *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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Sameera
> http://sameera-jayasoma.blogspot.com/
> http://www.flickr.com/photos/sameera-jayasoma
>



-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

Re: thread safe axis2 client stub

Posted by Afkham Azeez <af...@gmail.com>.
No, you can use a single ConfigurationContext across multiple threads.
However, if multiple thread are going to simultaneously going to change the
same properties in the Config ctx, you will need to handle the
synchronization yourself. This is true for server side code as well.

HTH
Azeez

On Mon, Dec 22, 2008 at 12:12 AM, Afkham Azeez <af...@gmail.com> wrote:

> No, you can use a single ConfigurationContext across thread. However, if
> multiple thread are going to simultaneously going to change the same
> properties in the Config ctx, you will need to handle the synchronization
> yourself. This is true for server side code as well.
>
> HTH
> Azeez
>
>
> On Mon, Dec 15, 2008 at 11:21 AM, Shehan Simen <ss...@itree.com.au>wrote:
>
>>  Hi Samera,
>>
>> So do we have to create a ConfigurationContext for each thread? Is'nt it
>> too much for each thread?
>>
>>
>>
>> Regards,
>>
>> Shehan
>>
>>
>>
>> *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com]
>> *Sent:* 2008-12-15 15:06
>>
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>>
>>
>> On Tue, Dec 9, 2008 at 9:50 PM, Paul French <pa...@kirona.com>
>> 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.
>>
>>
>> you get the above message, when creating a new ConfigurationContext
>> instance. Creating a CC instance is a heavy operation, therefore you can
>> instantiate a CC instance once and use it for all subsequent calls.
>>
>> Sameera
>>
>>
>>
>>
>> The link below suggests some tricks you can do to make things more
>> efficient. What are these tricks?
>>
>>
>>
>> Thanks
>>
>> Paul
>>
>>
>>  ------------------------------
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
>>
>> *Sent:* 09 December 2008 04:26
>>
>>
>> *To:* axis-user@ws.apache.org
>> *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 <ss...@itree.com.au>
>> wrote:
>>
>> Also this link:
>>
>>
>> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>>
>>
>>
>>
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
>> *Sent:* 2008-12-08 15:26
>>
>>
>> *To:* axis-user@ws.apache.org
>> *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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
>> *Sent:* 2008-12-08 15:13
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>> yes
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/
>>
>>
>>
>>
>> --
>> Amila Suriarachchi
>> WSO2 Inc.
>> blog: http://amilachinthaka.blogspot.com/
>>
>>
>>
>>
>> --
>> Sameera
>> http://sameera-jayasoma.blogspot.com/
>> http://www.flickr.com/photos/sameera-jayasoma
>>
>
>
>
> --
> 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
>



-- 
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

Re: thread safe axis2 client stub

Posted by Afkham Azeez <af...@gmail.com>.
No, you can use a single ConfigurationContext across thread. However, if
multiple thread are going to simultaneously going to change the same
properties in the Config ctx, you will need to handle the synchronization
yourself. This is true for server side code as well.

HTH
Azeez

On Mon, Dec 15, 2008 at 11:21 AM, Shehan Simen <ss...@itree.com.au> wrote:

>  Hi Samera,
>
> So do we have to create a ConfigurationContext for each thread? Is'nt it
> too much for each thread?
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Sameera Jayasoma [mailto:sameera.madushan@gmail.com]
> *Sent:* 2008-12-15 15:06
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
>
>
> On Tue, Dec 9, 2008 at 9:50 PM, Paul French <pa...@kirona.com>
> 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.
>
>
> you get the above message, when creating a new ConfigurationContext
> instance. Creating a CC instance is a heavy operation, therefore you can
> instantiate a CC instance once and use it for all subsequent calls.
>
> Sameera
>
>
>
>
> The link below suggests some tricks you can do to make things more
> efficient. What are these tricks?
>
>
>
> Thanks
>
> Paul
>
>
>  ------------------------------
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
>
> *Sent:* 09 December 2008 04:26
>
>
> *To:* axis-user@ws.apache.org
> *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 <ss...@itree.com.au> wrote:
>
> Also this link:
>
>
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:26
>
>
> *To:* axis-user@ws.apache.org
> *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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Sameera
> http://sameera-jayasoma.blogspot.com/
> http://www.flickr.com/photos/sameera-jayasoma
>



-- 
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

RE: thread safe axis2 client stub

Posted by Shehan Simen <ss...@itree.com.au>.
Hi Samera,
So do we have to create a ConfigurationContext for each thread? Is'nt it too much for each thread?

Regards,
Shehan

From: Sameera Jayasoma [mailto:sameera.madushan@gmail.com]
Sent: 2008-12-15 15:06
To: axis-user@ws.apache.org
Subject: Re: thread safe axis2 client stub


On Tue, Dec 9, 2008 at 9:50 PM, Paul French <pa...@kirona.com>> 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.

you get the above message, when creating a new ConfigurationContext instance. Creating a CC instance is a heavy operation, therefore you can instantiate a CC instance once and use it for all subsequent calls.

Sameera


The link below suggests some tricks you can do to make things more efficient. What are these tricks?

Thanks
Paul

________________________________
From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com<ma...@gmail.com>]
Sent: 09 December 2008 04:26

To: axis-user@ws.apache.org<ma...@ws.apache.org>
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 <ss...@itree.com.au>> wrote:

Also this link:

http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results





From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com<ma...@gmail.com>]
Sent: 2008-12-08 15:26

To: axis-user@ws.apache.org<ma...@ws.apache.org>
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 <ss...@itree.com.au>> 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:amilasuriarachchi@gmail.com<ma...@gmail.com>]
Sent: 2008-12-08 15:13
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: thread safe axis2 client stub



yes

thanks,
Amila.

On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au>> 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/



--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/



--
Sameera
http://sameera-jayasoma.blogspot.com/
http://www.flickr.com/photos/sameera-jayasoma

Re: thread safe axis2 client stub

Posted by Sameera Jayasoma <sa...@gmail.com>.
On Tue, Dec 9, 2008 at 9:50 PM, Paul French <pa...@kirona.com> 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.
>

you get the above message, when creating a new ConfigurationContext
instance. Creating a CC instance is a heavy operation, therefore you can
instantiate a CC instance once and use it for all subsequent calls.

Sameera


>
> The link below suggests some tricks you can do to make things more
> efficient. What are these tricks?
>
> Thanks
> Paul
>
>  ------------------------------
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* 09 December 2008 04:26
>
> *To:* axis-user@ws.apache.org
> *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 <ss...@itree.com.au> wrote:
>
>>  Also this link:
>>
>>
>> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>>
>>
>>
>>
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
>> *Sent:* 2008-12-08 15:26
>>
>> *To:* axis-user@ws.apache.org
>> *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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
>> *Sent:* 2008-12-08 15:13
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>> yes
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/
>>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>



-- 
Sameera
http://sameera-jayasoma.blogspot.com/
http://www.flickr.com/photos/sameera-jayasoma

Axis2, Ecliplse and performance issues.

Posted by Nowak Brad <Br...@thomson.net>.
I was required to make a standalone Java app that will serve as a soap
client.

I used the wsdl2java.bat file to generate the stub and I built my
program around that with the axis2 library jars in the Java Build Path.

 

When I run the program inside of Eclipse the SOAP operations are fast,
taking less than a second to send and receive, but when I export to a
runnable jar, the SOAP operations slow down considerably.  It takes
about 2 seconds from a button click before the SOAP operation is even
sent out.  I have discovered that the "pause" takes place immediately
after initiating a stub from the wsdl2java generated code.

 

Any suggestions on how to make the speed of the runnable jar match that
of running the program inside eclipse?  Maybe an alternate way to
package the libraries?

 

Thanks in advance,

 

Brad


RE: thread safe axis2 client stub

Posted by Paul French <pa...@kirona.com>.
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:amilasuriarachchi@gmail.com] 
Sent: 09 December 2008 04:26
To: axis-user@ws.apache.org
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 <ss...@itree.com.au> wrote:


Also this link:

http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20t
hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results

 

 

From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com] 
Sent: 2008-12-08 15:26 


To: axis-user@ws.apache.org
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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com] 
Sent: 2008-12-08 15:13
To: axis-user@ws.apache.org
Subject: Re: thread safe axis2 client stub

 

yes

thanks,
Amila.

On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/




-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Re: thread safe axis2 client stub

Posted by Amila Suriarachchi <am...@gmail.com>.
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 <ss...@itree.com.au> wrote:

>  Also this link:
>
>
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:26
>
> *To:* axis-user@ws.apache.org
> *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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

RE: thread safe axis2 client stub

Posted by Shehan Simen <ss...@itree.com.au>.
Also this link:
http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results


From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
Sent: 2008-12-08 15:26
To: axis-user@ws.apache.org
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 <ss...@itree.com.au>> 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:amilasuriarachchi@gmail.com<ma...@gmail.com>]
Sent: 2008-12-08 15:13
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: thread safe axis2 client stub



yes

thanks,
Amila.

On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au>> 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/

RE: thread safe axis2 client stub

Posted by Shehan Simen <ss...@itree.com.au>.
Follow the link
http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:1+mid:iif5rdpgqahk4u5t+state:results


From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
Sent: 2008-12-08 15:26
To: axis-user@ws.apache.org
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 <ss...@itree.com.au>> 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:amilasuriarachchi@gmail.com<ma...@gmail.com>]
Sent: 2008-12-08 15:13
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: thread safe axis2 client stub



yes

thanks,
Amila.

On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au>> 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/

Re: thread safe axis2 client stub

Posted by Amila Suriarachchi <am...@gmail.com>.
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 <ss...@itree.com.au> 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:amilasuriarachchi@gmail.com]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/

RE: thread safe axis2 client stub

Posted by Shehan Simen <ss...@itree.com.au>.
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:amilasuriarachchi@gmail.com]
Sent: 2008-12-08 15:13
To: axis-user@ws.apache.org
Subject: Re: thread safe axis2 client stub

yes

thanks,
Amila.
On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au>> 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/

Re: thread safe axis2 client stub

Posted by Amila Suriarachchi <am...@gmail.com>.
yes

thanks,
Amila.

On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen <ss...@itree.com.au> 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/