In the original axis bug, multiple clients would end up "merging" onto the same session and I think that I was just being overly paranoid about proving that the defect was in axis and not in my service's handling of the instance data.
You can safely ignore the extra synchronization... alan > -----Original Message----- > From: Rajal Shah [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 6:10 PM > To: [EMAIL PROTECTED] > Subject: RE: Session scope and threaded request? > > > Many thanks.. Perfect example to try out the session stuff.. > One question: In your example, StatefulService.java:- why do > you synchronize in the getMyInstance() method? > > The same session specific StatefulService class's > getMyInstance() method would be invoked for all Client1 > requests (with each request coming in on a separate thread). > The myInstance variable is specific for each session and thus > you wouldn't need to sync it to avoid concurrent accesses > with other session invocations? > > Here is the StatefulService.java code for reference: > public class StatefulService { > > static private Object lock = new Object(); > static private int instanceCount = 0; > private int myInstance; > > public StatefulService() > { > synchronized ( lock ) > { > instanceCount++; > myInstance = instanceCount; > } > } > > public int getMyInstance() > { > synchronized ( lock ) > { > return myInstance; > } > } > } > > -- > Rajal > > > -----Original Message----- > From: Alan Moore [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 5:26 PM > To: '[EMAIL PROTECTED]' > Subject: RE: Session scope and threaded request? > > > There is likely to be an example in the samples and I know > there is a unit > test for session. > > In addition, there was a defect in Axis session handling and > I provided a > client and server that reproduced the problem. This can be found as an > attachment here: > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11305 > > Good luck! > > alan > > > > -----Original Message----- > > From: Rajal Shah [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, September 18, 2002 2:31 PM > > To: [EMAIL PROTECTED] > > Subject: RE: Session scope and threaded request? > > > > > > Ok.. I still need to get this session behvior verified. It > > would be great if anyone can provide an example showing a > > client & server session behavior. It would shorten my initial > > learning curve with Axis. > > > > -- > > Rajal > > > > > > -----Original Message----- > > From: Ramon Turnes [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 11:36 PM > > To: '[EMAIL PROTECTED]' > > Subject: RE: Session scope and threaded request? > > > > > > In case of session scope, each session has its own instance of the > > service class independently of which thread invokes the exposed > > methods. I suppose that the servlet engine starts a new thread for > > each request, at least MessageContext.getCurrentContext() works > > in such manner. In case of application scope, for example, each > > request is handled by the same class instance. Take a look at > > org\apache\axis\providers\java\JavaProvider.java. Regards. > > > > > -----Original Message----- > > > From: Rajal Shah [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, September 18, 2002 1:18 AM > > > To: [EMAIL PROTECTED] > > > Subject: Session scope and threaded request? > > > > > > > > > Hello. > > > > > > When the scope of the service is "session", then do each > > > request come as a separate thread and invokes the appropriate > > > method in the class (like the servlet behaviour?) > > > > > > If not, do I need to extend my service class to a predefined > > > Axis class get this behavior? > > > > > > Any blurb on how the requests are processed in such scenarios > > > (session scope and application scope) will be much appreciated. > > > > > > Regards. > > > -- > > > Rajal > > > > > >