code: public <T> long bulkGraphOperation(final SecurityContext securityContext, final Iterator<T> iterator, final long commitCount, String description, final BulkGraphOperation<T> operation, boolean validation) {
  
  		final Predicate<Long> condition = operation.getCondition();
  		final App app                   = StructrApp.getInstance(securityContext);
  		final boolean doValidation      = operation.doValidation();
  		final boolean doCallbacks       = operation.doCallbacks();
  		final boolean doNotifications   = operation.doNotifications();
  		long objectCount                = 0L;
  		boolean active                  = true;
  
  		while (active) {
  
  			active = false;
  
  			try (final Tx tx = app.tx(doValidation, doCallbacks, doNotifications)) {
  
  				while (iterator.hasNext() && (condition == null || condition.accept(objectCount))) {
  
  					T node = iterator.next();
  					active = true;
  
  					try {
  
  						boolean success = operation.handleGraphObject(securityContext, node);
  						if (success) {
  							objectCount++;
  						}
  
  					} catch (Throwable t) {
  
  						operation.handleThrowable(securityContext, t, node);
  					}
  
  					// commit transaction after commitCount
  					if ((objectCount % commitCount) == 0) {
  						break;
  					}
  				}
  
  				tx.success();
  
  			} catch (Throwable t) {
  
  				// bulk transaction failed, what to do?
  				operation.handleTransactionFailure(securityContext, t);
  			}
  
  			if (description != null) {
  				info("{}: {} objects processed", description, objectCount);
  			}
  		}
  
  		return objectCount;
  	}
docs: Executes the given operation on all nodes in the given list.
  
  @param <T>
  @param securityContext
  @param iterator the iterator that provides the nodes to operate on
  @param commitCount
  @param description
  @param operation the operation to execute
  @param validation
  @return the number of nodes processed