Originally posted by Scott Selikoff:
What you might want is a truncate statement instead of a delete. This issues an immediate delete with no rollback possibility. Since you are deleting 1000 at a time and committing, it sounds like you want to skip rollback all together so truncate is probably the best choice.
TRUNCATE is a SQL statement that is not supported on all databases. For example, Oracle and MySQL have it, and Postgres (apparently) does not.
Furthermore, it is almost the equivalent of dropping and recreating the table. The OP only wants to delete rows that meet a certain criteria, not all rows.
In some databases (e.g. Oracle and Postgres), this problem is sometimes resolved by partitioning the table and then dropping the appropriate partition (which may or may not produce logging, depending on the DB). Other times, disableing logging and then reanabling and doing a full backup is the solution. Other times, deleting in smaller batches will work. The best way to do that depends on your database. In Oracle, you can limit a DELETE to some number of rows with a "WHERE rownum < [value]" clause.
For example:
Most frameworks and O/R mappers I know don't let you work this way, using DB-dependent features, but I don't know anything about Spring. In the ones I do know, you have to have a selection criteria that effictively limits the delete to the size you want.