code: public void execute() throws FrameworkException {
  
  		final DatabaseService graphDb = (DatabaseService) arguments.get("graphDb");
  		final NodeFactory nodeFactory = new NodeFactory(securityContext);
  
  		if (graphDb != null) {
  
  			Iterator<NodeInterface> nodeIterator = null;
  			final App app = StructrApp.getInstance();
  
  			try (final Tx tx = app.tx()) {
  
  				nodeIterator = app.nodeQuery(NodeInterface.class).getAsList().iterator();
  				tx.success();
  
  			} catch (FrameworkException fex) {
  				logger.warn("Exception while creating all nodes iterator.", fex);
  			}
  
  			final long deletedNodes = bulkGraphOperation(securityContext, nodeIterator, 1000, "ClearDatabase", new BulkGraphOperation<NodeInterface>() {
  
  				@Override
  				public boolean handleGraphObject(SecurityContext securityContext, NodeInterface node) {
  
  					// Delete only "our" nodes
  					if (node.getProperty(GraphObject.id) != null) {
  
  						try {
  							app.delete(node);
  
  						} catch (FrameworkException fex) {
  							logger.warn("Unable to delete node {}: {}", new Object[] { node.getUuid(), fex.getMessage() } );
  						}
  					}
  
  					return true;
  				}
  
  				@Override
  				public void handleThrowable(SecurityContext securityContext, Throwable t, NodeInterface node) {
  					logger.warn("Unable to delete node {}: {}", new Object[] { node.getUuid(), t.getMessage() } );
  				}
  
  				@Override
  				public void handleTransactionFailure(SecurityContext securityContext, Throwable t) {
  					logger.warn("Unable to clear database: {}", t.getMessage() );
  				}
  			});
  
  			logger.info("Finished deleting {} nodes", deletedNodes);
  
  		}
  	}
docs: ~--- methods --------------------------------------------------------