tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike W-M" <m...@ward-murphy.co.uk>
Subject Re: HttpSession issues
Date Wed, 18 Dec 2002 02:18:11 GMT
This is nothing in particular to do with Tomcat, more with multi-threaded
programming.
The exception is used to indicate that whatever you've started iterating
through has been changed in the meantime.
The likely scenario here is that some other request is running at the same
time as you're doing your looping and it's adding or deleting a session
attribute.  Check the java.util javadocs for more info.

I think the solution will be to synchronise the enumerating block of code,
and all other blocks that modify the session attributes, on the session
object.  It's generally good practice to minimise the amount of code that
needs to be synchronised (and the time it takes) for performance reasons.

Mike.


----- Original Message -----
From: "Felipe Schnack" <felipes@ritterdosreis.br>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Tuesday, December 17, 2002 9:12 PM
Subject: HttpSession issues


  There's something problematic about the Enumeration i get from
HttpSession.getAttributeNames?
  I have some situations in my application that I have to loop thru all
my session attributes, but for some reason sometimes I get an
"java.util.ConcurrentModificationException" then looping them...
  The strangest thing is that a developer here get this error when he
reloads a page, but it doesn't happen when he press enter in the URL
bar... and this JSP file isn't the target of an HTML form... but
receives parameters from the query string
  I'm using JDK 1.4.1 and Tomcat 4.1.12

--

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message