Batch delete using EJBs


EJB programming & troubleshooting: Batch delete using EJBs

  1. Batch delete using EJBs (5 messages)

    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.


    Threaded Messages (5)

  2. 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.
  3. 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.

  4. Batch delete using EJBs[ Go to top ]

    I would do this as a JDBC statement in a SLSB.

  5. Batch delete using EJBs[ Go to top ]

    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?
  6. Deleting behind the container.[ Go to top ]

    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???