I want to run a code in background just like daemon thread or something like that which will check the current date and eventually fire a database related query once the date matches. Now my question is how should i do this. whether to use listener or something else. i am not sure where to start from. I am stuck up here Any help would be appreciated.
[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
thanks for the reply. what i want is that in my web application. for e.g: i have a page CreateExam where exams are scheduled. Once the exam has been conducted on the specified date i want to delete that record automatically after the exam date. now for implementing this what should i use a Listener may be i guess or something else which you guys can suggest me the best.
Joined: Mar 22, 2005
Have you looked at the classes I mentioned? You can set those up in a servlet context listener when the web app is started.
Perhaps you can use the session's timeout mechanism for this instead. For each request, set the maximum inactive time to be just after the exam date (you can use a Filter for this). Then have a HttpSessionListener remove the record in its sessionDestroyed method.
thank you guys, i have decided to go with servlet context listener as i need to do many things throughout my application automatically based on an event like date or time. i will try and tell you what happened. thanks for the help and support. thank you very everybody