I have a task here and needed some inputs from you guys.
This task needs to be done using jdk1.4 only in weblogic 9 server
I have written a small thread which runs as a start up class once i a start my weblogic server.
I am making this thread poll the database every 5 min to check is there are any invalid recrods and if they are found This thread deletes it and sends email to user.
This works fine.
Now I have to also add one more new task to this in the same class.
I have to also send emails every midnight about the records in the database.
Here is where i am facing problem.
suppose i start my weblogic server at 5.00 pm then my program needs to calculate the midnight time and trigger exactly at midnight and there after run every midnight. simultaneously the polling mechanism i wrote should run as i have implemented every 5 min.
How can i achieve this in the same class? Do I need to start a seprate thread?
I came across a article which says timer task and timer in jdk1.4 should not be used in a managed environment like weblogic container as it runs a thread which is out of the scope of weblogic.
How do i go about this?