I have a requirement of deleting bulk records from some history tables. The table information from which the records has to be deleted will be kept in a temp table. The records in the history tables are in millions for which I want to delete them in batches so that the delete operation don�t fill up the log space in the Database. I am not using stored proc for this task as the table name has to be given as a parameter while executing the proc. So had finally thought of doing it in hibernate or plain JDBC. I tried using setMaxResults (int batchSIze) for doing it in batches but this is not for delete operation I think since the delete operation was not done in batches after setting setMaxResults
. I am using native SQL for achieving this since I wanted to do away with mappings for these history tables.
Any pointers on how this can be achieved in hibernate or plain JDBC? It would be better if someone can share the source for achieving this task.
Thanks much in advance.
[ January 21, 2008: Message edited by: Chinmay Subudhiray ]