Hi,
Please have a look at the code fragment ive given below
public class PSPsendDoc extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
...........lines of code
UIS.addElement(..);
UIS.addElement(..);
.................
}
private Vector UIS = new Vector();
}
This
servlet of mine can be called by several users at a time. Thus there is a very high probability that this servlet may be called my several clients almost at the same time.
So my question is , does this mean that the vector UIS is prone to get updated in a
thread unsafe way??
If it is so, how do i make it thread safe, such that different requests to the servlets will use their own UIS's and not update the UIS of some other thread
Kindest regards
Saj