This adds a simple log message but also allows EE to insert database events within the transaction (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6059/diffs).