Order locks when locking in BaseTransactionExecution to prevent deadlocks.