I completely agree with Chuck, and completely disagree with Neil.  

Never rely upon static state in servlet classes unless you have complete
control over class loading, which you shouldn't, otherwise you'd write
your own servlet container.

As Chuck says, it is not a Tomcat issue, but one for the DB.


-----Original Message-----
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Tuesday, November 17, 2009 10:13 AM
To: Tomcat Users List
Subject: RE: synchronizing in tomcat

> From: Neil Aggarwal [mailto:n...@jammconsulting.com]
> Subject: RE: synchronizing in tomcat
> 
> At first thought, I would create a class
> with synchronized static methods to do each of your
> processing tasks.  That way, you are guaranteed
> only one method is executing at a time.

That's probably not going to work, since the posted scenario sounds more
like a shopping cart situation, requiring lockout across multiple
requests.  Regardless, this has nothing to do with Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to