This is mainly used to sort the LimitSum objects before they get locked to make sure no dead-lock occurs.