code: private int runTransactionalAssignment(final TargetFilterQuery targetFilterQuery, final Long dsId) {
          final String actionMessage = String.format(ACTION_MESSAGE, targetFilterQuery.getName());
  
          return DeploymentHelper.runInNewTransaction(transactionManager, "autoAssignDSToTargets",
                  Isolation.READ_COMMITTED.value(), status -> {
                      final List<TargetWithActionType> targets = getTargetsWithActionType(targetFilterQuery.getQuery(),
                              dsId, targetFilterQuery.getAutoAssignActionType(), PAGE_SIZE);
                      final int count = targets.size();
                      if (count > 0) {
                          deploymentManagement.assignDistributionSet(dsId, targets, actionMessage);
                      }
                      return count;
                  });
      }
docs: Runs one page of target assignments within a dedicated transaction
  
  @param targetFilterQuery
  the target filter query
  @param dsId
  distribution set id to assign
  @return count of targets