I am using WebLogic 6.0 sp1 with EJB 2.0 (CMP's). We need to delete records which have been residing in the database for more than 150 days from the creation date.
How can I do this? Implementing a finder method and deleting each individual record on each table will be a big performance kill.
Do I need to write a BMP for this?
Any other suggestions/comments would be very helpful.
This looks like a requirement for deleting orders in the database for a commerce application. This can be done as a batch process scheduled to run everyday at 12am. Write a Scheduler component and a scheduled job component.
Sure, The job will be scheduled.
How do I implement scheduled job as CMP's or BMP's. or any other approach which U can think of.
I would do this as a JDBC statement in a SLSB.
I would write a SQL DELETE statement, put it in a text file, write a shell script that passes the text file to the DBMS command interpreter (like SQL*Plus), and then cron the shell script.
Why would you even consider writing an EJB for a task as simple as this?
What happends if the container is caching CMPs for rows that you are deleting behind the scene using an SQL script?
If you use CMPs to delete it will be handled by the container, but if you use an SQL script to clean up, couldnt that mean trouble???