tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vaneet Sharma <>
Subject RE: Conncurency issue with tomcat???
Date Thu, 16 May 2002 14:13:15 GMT
Sychronize the method
  that is using hastable 
or synchronize the.... Block 
   it will work

-----Original Message-----
From: Ghorpade, Rajendra []
Sent: 16 May 2002 16:04
To: 'Tomcat Users List'
Subject: RE: Conncurency issue with tomcat???

Sorry, I mean to say I do not invalidate the session myself but it is
invalidated by tomcat.
After the 5th step I send a request without the cookie so new session is
created on the server.

I myself is not managing the sesion but it just a simple check in service
method to avoid same sassion id to be allocated to two threads.
As the hashtable is a member of the servlet(my srvlet) I keep a record of
the ongoing sesions in this hashtable.As I am adding and removing the
sesions to this hashtable in the service method itself this ensures that for
N number of threads(concurrent) there should be always N different entries
in the hashtable.If the session id from any request thread is one already
present in the hashtable that means the servlet engine is allowing the same
session id to be used by two different threads at the same time.Because one
thread is already working on this session.

Hope u understand my english ...:-)

Did u get what i have to say??


-----Original Message-----
From: peter lin []
Sent: Thursday, May 16, 2002 3:41 PM
To: Tomcat Users List
Subject: Re: Conncurency issue with tomcat???

try changing it so it doesn't invalidate the session.   If the duplicate
sessions do not appear, you know the culprit. The thing about checking
the session id's yourself is it won't be reliable, unless you generate
your own unique ID and manage it. Otherwise, just let catalina manage
the session life cycle.

Unless the state of session life cycle on tomcat and your client app are
synchronized, the client is going to get duplicate session id's.


"Ghorpade, Rajendra" wrote:
> Peter,
> I do invalidate session after  the 5th step.
> And the check which I apply in the service method is only in the service
> method. I mean I add and remove the session Ids in the service method
> itself.Just to check that the ongoing session id is not give to any other
> request thread.
> So there should'nt be new thread started with the same session which is
> already in progress.!!
> I have also posted this on the dev list.But not any answer yet.
> Thanxs,
> raj
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message