Extract the auditing so that it gets wrapped in a transaction.