Package org.structr.core.app

Examples of org.structr.core.app.App.tx()


    final Long port                      = (Long)properties.get("port");

    if (sourceId != null && host != null && port != null && username != null && password != null && key != null) {

      final App app    = StructrApp.getInstance();
      try (final Tx tx = app.tx()) {

        boolean recursive = false;
        if (recursiveSource != null) {

          recursive = "true".equals(recursiveSource.toString());
View Full Code Here


    while (hasChanges) {

      hasChanges = false;

      try (final Tx tx = app.tx(false, false)) {

        // iterate over all nodes,
        final Iterator<Node> allNodes = GlobalGraphOperations.at(graphDb).getAllNodes().iterator();
        while (allNodes.hasNext()) {
View Full Code Here

    hasChanges = true;
    while (hasChanges) {

      hasChanges = false;

      try (final Tx tx = app.tx(false, false)) {

        final Iterator<Relationship> allRels = GlobalGraphOperations.at(graphDb).getAllRelationships().iterator();
        while (allRels.hasNext()) {

          final Relationship rel = allRels.next();
View Full Code Here

    final Iterator<T> iterator = nodes.iterator();
    long objectCount           = 0L;

    while (iterator.hasNext()) {

      try (final Tx tx = app.tx()) {

        while (iterator.hasNext()) {

          T node = iterator.next();
View Full Code Here

    final App app                = StructrApp.getInstance(securityContext);
    final AtomicLong objectCount = new AtomicLong(0L);

    while (!stopCondition.evaluate(securityContext, objectCount.get())) {

      try (final Tx tx = app.tx()) {

        long loopCount = 0;

        while (loopCount++ < commitCount && !stopCondition.evaluate(securityContext, objectCount.get())) {
View Full Code Here

   */
  public static void exportToFile(final GraphDatabaseService graphDb, final String fileName, final boolean includeFiles) throws FrameworkException {

    final App app = StructrApp.getInstance();

    try (final Tx tx = app.tx()) {

      exportToStream(
        new FileOutputStream(fileName),
        app.nodeQuery(NodeInterface.class).getAsList(),
        app.relationshipQuery(RelationshipInterface.class).getAsList(),
View Full Code Here

    final BufferedReader reader = new BufferedReader(new InputStreamReader(zis));

    do {

      try (final Tx tx = app.tx(doValidation)) {

        final List<Relationship> rels = new LinkedList<>();
        final List<Node> nodes        = new LinkedList<>();
        long nodeCount                = 0;
        long relCount                 = 0;
View Full Code Here

    final Map<String, List<TypeInfo>> typeInfoTypeMap = new LinkedHashMap<>();
    final List<TypeInfo> reducedTypeInfos             = new LinkedList<>();
    final List<TypeInfo> typeInfos                    = new LinkedList<>();

    // second step: analyze schema of newly created nodes, skip existing ones (structr & spatial)
    try (final Tx tx = app.tx()) {

      // register transaction post process that rebuilds the index after successful creation
      TransactionCommand.postProcess("reloadschema", new ReloadSchema());

      // analyze nodes
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.