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 Ramya K Grama <ra...@gmail.com> on 2009/08/12 00:48:24 UTC
Axis2 - response message time out
Hello,
I'm designing a web service (using Axis2) which makes a database (Stored
procedure) call through Hibernate.
The stored procedure in turn does a series of business logic and makes a
call to Subsystem B and waits for x time till the response comes back. If
there is a timeout then throws an error. If not, gets the return data and
passes it onto the web service, which then creates the SOAP response and
sends it out.
My question and concern is regarding the "timeout" logic. How can the
"timeout" be set in the web service layer (Skeleton). Coz if I dont tell the
Skeleton to wait for that period of time, the connection might time out.
Or to put it in another way, how do I override the default DB
connection/response timeout with the expected timeout delay.
Should this be done in the web service layer or in the hibernate layer
(since we are using Hibernate to connect to the database) or should it be
done in both?
Your help is highly appreciated!
Thanks,
wsnewbie
Re: [Axis2] Architecture Question (Concurrency)
Posted by Deepal jayasinghe <de...@gmail.com>.
Marc Lefebvre wrote:
> I am deploying a POJO webservice using Axis2 and Java2Wsdl, etc...
> Its all working nicely, but in developing the java code of my
> webservice I had some questions about HOW internally Axis works so
> that I can be sure of some possible issues that may arise.
>
> Does Axis create a separate thread for each webservice call? I am
> assuming yes at this point.
Yes, each request is handle by a separate thread. In the case of
SimpleHTTP Server we use Thread pool, and in the case of App server, we
use the thread given by the app server.
>
> If so, then, in the webservice any data structure that is accessed by
> these threads must be thread safe. Right?
As long as you have written the code not to have class variables, then
it would. Depending on the service scope we create different number of
service class instances. For example, for request scope we create new
service instance for each service scope, whereas for Application scope
we have single instance of the service class.
>
> So, for example, if I had a HashMap that gets populated, read, and
> deleted by webservice calls, I need to use the concurrent libraries
> version of this HashMap. Right? Otherwise there could be contention
> issues.
I think that would be a good idea.
>
> I am assuming the Axis framework does not provide ANY kind of
> protection against concurrency issues.
>
> Are there any other issues I should keep in mind in developing the
> webservice due to the architecture of Axis?
I think stateless nature is something you need to keep in mind, do not
try to store values in your service class, instead use different
contexts provided by Axis2.
Thanks,
Deepal
>
> Thanks...
>
--
Thank you!
http://blogs.deepal.org
http://deepal.org
[Axis2] Architecture Question (Concurrency)
Posted by Marc Lefebvre <ml...@akimeka.com>.
I am deploying a POJO webservice using Axis2 and Java2Wsdl, etc... Its
all working nicely, but in developing the java code of my webservice I
had some questions about HOW internally Axis works so that I can be sure
of some possible issues that may arise.
Does Axis create a separate thread for each webservice call? I am
assuming yes at this point.
If so, then, in the webservice any data structure that is accessed by
these threads must be thread safe. Right?
So, for example, if I had a HashMap that gets populated, read, and
deleted by webservice calls, I need to use the concurrent libraries
version of this HashMap. Right? Otherwise there could be contention
issues.
I am assuming the Axis framework does not provide ANY kind of protection
against concurrency issues.
Are there any other issues I should keep in mind in developing the
webservice due to the architecture of Axis?
Thanks...