Class AuditWorkQueue

java.lang.Object
org.hibernate.audit.spi.AuditWorkQueue
All Implemented Interfaces:
TransactionCompletionCallbacks.BeforeCompletionCallback, TransactionCompletionCallbacks.CompletionCallback

public class AuditWorkQueue extends Object implements TransactionCompletionCallbacks.BeforeCompletionCallback
Transaction-scoped queue for deferred audit row writes.

Mutation coordinators enqueue audit entries instead of writing them inline during flush. Entries are keyed by EntityKey. When the same entity is modified multiple times within a transaction, entries are merged according to the following merge rules:

  • ADD + MOD -> ADD (with latest state)
  • ADD + DEL -> entries cancel out (no audit row)
  • MOD + MOD -> MOD (with latest state)
  • MOD + DEL -> DEL
  • DEL + ADD -> MOD (entity re-created with potentially different state)
All audit rows (INSERT + optional REVEND UPDATE) are written at beforeTransactionCompletion.
Since:
7.4
See Also:
  • Constructor Details

    • AuditWorkQueue

      public AuditWorkQueue()
  • Method Details