struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: general Thread disscussion
Date Tue, 01 Feb 2005 19:23:28 GMT

>To be honest, I've only heard this in the past few days.  I didn't know that, generically,
writing files was "forbidden" by J2EE.  I knew it was something you generally want to avoid
from a webapp for other reasons, but it's news to me too :)  So no, I don't have any reference
I can point you to.  I'd be interested in such a reference myself!
Ok i will inform you, when i found a reference.

>Just want to be sure I follow... Do you mean a case where you have a class along these
>public class myData {
>  public static HashMap data = new HashMap();
>... and you might be reading and/or writing from this during the course of processing
a reqeust AS WELL AS from a background thread?  If that's the question, the answer is you
need to be very careful.  You can synchronize all access to the HashMap, but then you are
introducing a bottleneck into the system at best, and a potential deadlock or any one of the
other multitude of thread contention issues that confuse the hell out of most of us when they
crop up!
>If your static information is read-only, you have no issue of course.  I do this in that
application I was talking about... I have a class almost identical to what you see above except
that the HashMap is private and I have a getter/setter pair.  It's never altered during the
run of the application though, after startup anyway, so no problem.  If it could be altered
though, that would change matters.
Thats excectly what i want. An altered ressource during the run. So i 
have to find another solution for this case.

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

View raw message