No, the destroy method and access to the destroy method is managed by the container. Besides, synchronising the method will have no effect (assuming it is called once) unless other methods in the class are also synchronised. If you are really worried you should look at read and write locks rather than mutual exclusion (mutex) locks, but I've never been bothered by the destroy method at all.
Amol Nayak
Ranch Hand
Joined: Oct 26, 2006
Posts: 218
posted
0
This is the description in the Javadocs for javax.servlet.Servlet Hope this should clear your doubts.. Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. This method is only called once all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls this method, it will not call the service method again on this servlet. This method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the servlet's current state in memory