Self-Running Object Inst. by Servlet. Interfering with Servlet Reloading
843833Aug 7 2001 — edited Aug 8 2001Hi everyone.
I have a Servlet that instantiates an instance of another class that I defined. It is a self-running data-structure, using Threads to continuously update it based on DB information... very neat.
My problem is, when I make a modification to my servlet, I have to restart Tomcat in order for it to work properly. (I think what is going on is that the JVM keeps running the other object, so when I try to call the servlet again, i get a wierd message "....who added this?")
So i want to know how i can fix this problem. One idea I had is to call the self running object's stopRunning() method from the servlet's destroy() method, in hopes that in reloading the servlet, tomcat will first call destroy() on the one already in memory. I haven't tried that yet, though, because I don't have a stopRunning method yet, and I thought i'd get some ideas before busting out more code :)
What do you think????
Thanks,
X___________
tha PhatBarren