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 ; } ) ; }
Runs one page of target assignments within a dedicated transaction