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 Stefan Champailler <sc...@easynet.be> on 2004/09/28 13:36:13 UTC

Concurrency issues

Dear you all,

(DISLAIMER -- I'm newbie)

I've implemented a small webservices with Axis. It is coded as stateless EJB 
and I use the proper WSDD to tell Axis to wrap a web service around it (which 
it doesn well so far).

The stateless bean (SSB) is connected to an entity bean. When acting as a 
service, it does two things :

create a new instance of the Entity bean ( entity.create()...)
return a list of all the entity beans created so far ( entity.findAll()...).

I use a web browser to display the result of the service method. According to 
the code, each time I refresh the browser, the result list gets longer. Just 
perfect.

Now, if I refresh the browser view very frequently, I end up with this :

Entity not found: primaryKey=alpha1096369564587; CausedByException is:
 Entity not found: primaryKey=alpha1096369564587

I think I'm running into a concurrency problem, that is, I probably have some 
concurrent access to the entity bean. Now, since Axis is run as a servlet, 
I'd expect it to create a new stateless bean (the one embodying the service) 
for each session and so I shouldn't run into cocnurrency problems because 
calls to the service would be serialized. I'm sure that my understanding of 
Axis is wrong somewhere and that's why I ask here. Can someone tell me the 
root of my problems ?

Thank you for your patience,

Stefan


Re: Concurrency issues

Posted by Stefan Champailler <sc...@easynet.be>.
well, thank you for your answer !

Fact is : this seems like more of a J2EE understanding issue rather than an 
axis issue. So I'll see somewhere else.

Stefan.

> I have never used Axis with JBoss, so I'm not sure I'm right :0)
>
> Axis services have one of following scope: Application, Request and Session
> (see the user Guide for more information about....)
>
> Even when you have a Application scope, when Axis run the service as a
> Singleton,
> multiple calls to your service will run concurrently.... unless you
> use some synchronized method or block.
>
> Ivan de Aguirre
>
> On Tue, 28 Sep 2004 13:36:13 +0200, Stefan Champailler
>
> <sc...@easynet.be> wrote:
> > Dear you all,
> >
> > (DISLAIMER -- I'm newbie)
> >
> > I've implemented a small webservices with Axis. It is coded as stateless
> > EJB and I use the proper WSDD to tell Axis to wrap a web service around
> > it (which it doesn well so far).
> >
> > The stateless bean (SSB) is connected to an entity bean. When acting as a
> > service, it does two things :
> >
> > create a new instance of the Entity bean ( entity.create()...)
> > return a list of all the entity beans created so far (
> > entity.findAll()...).
> >
> > I use a web browser to display the result of the service method.
> > According to the code, each time I refresh the browser, the result list
> > gets longer. Just perfect.
> >
> > Now, if I refresh the browser view very frequently, I end up with this :
> >
> > Entity not found: primaryKey=alpha1096369564587; CausedByException is:
> >  Entity not found: primaryKey=alpha1096369564587
> >
> > I think I'm running into a concurrency problem, that is, I probably have
> > some concurrent access to the entity bean. Now, since Axis is run as a
> > servlet, I'd expect it to create a new stateless bean (the one embodying
> > the service) for each session and so I shouldn't run into cocnurrency
> > problems because calls to the service would be serialized. I'm sure that
> > my understanding of Axis is wrong somewhere and that's why I ask here.
> > Can someone tell me the root of my problems ?
> >
> > Thank you for your patience,
> >
> > Stefan

Re: Concurrency issues

Posted by Ivan Aguirre <iv...@gmail.com>.
I have never used Axis with JBoss, so I'm not sure I'm right :0)

Axis services have one of following scope: Application, Request and Session 
(see the user Guide for more information about....)

Even when you have a Application scope, when Axis run the service as a
Singleton,
multiple calls to your service will run concurrently.... unless you
use some synchronized method or block.

Ivan de Aguirre

On Tue, 28 Sep 2004 13:36:13 +0200, Stefan Champailler
<sc...@easynet.be> wrote:
> Dear you all,
> 
> (DISLAIMER -- I'm newbie)
> 
> I've implemented a small webservices with Axis. It is coded as stateless EJB
> and I use the proper WSDD to tell Axis to wrap a web service around it (which
> it doesn well so far).
> 
> The stateless bean (SSB) is connected to an entity bean. When acting as a
> service, it does two things :
> 
> create a new instance of the Entity bean ( entity.create()...)
> return a list of all the entity beans created so far ( entity.findAll()...).
> 
> I use a web browser to display the result of the service method. According to
> the code, each time I refresh the browser, the result list gets longer. Just
> perfect.
> 
> Now, if I refresh the browser view very frequently, I end up with this :
> 
> Entity not found: primaryKey=alpha1096369564587; CausedByException is:
>  Entity not found: primaryKey=alpha1096369564587
> 
> I think I'm running into a concurrency problem, that is, I probably have some
> concurrent access to the entity bean. Now, since Axis is run as a servlet,
> I'd expect it to create a new stateless bean (the one embodying the service)
> for each session and so I shouldn't run into cocnurrency problems because
> calls to the service would be serialized. I'm sure that my understanding of
> Axis is wrong somewhere and that's why I ask here. Can someone tell me the
> root of my problems ?
> 
> Thank you for your patience,
> 
> Stefan
> 
>