I just do not see pre-selecting the matching ids and then inserting records into the audit tables as a viable solution. Performance does matter, and even in ORM itself there are well understood limitations to these bulk operations. I can see a number of options though:
- Use triggers as the basis for auditing - I've always thought this would be a great avenue to investigate anyway.
- Extend the MultiTableBulkIdStrategy processing to also consider whether the entity is audited and let it use the populated id table. Deletes are easy(ish) here, but updates would be difficult
- This would strictly be for 6.0, but if we do end up leveraging anon procedure blocks, we could have envers insert its statements into the block we send for the bulk update/delete.
|