Add comprehensive locking around DB transactions
#28726

matthewd wants to merge matthewd:transaction-locking into rails:master

We do not currently have an analysis of these two commits