Examples of tx()


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

      if (StringUtils.isBlank(input)) {
        input = "{}";
      }

      // isolate input parsing (will include read and write operations)
      try (final Tx tx = app.tx()) {
        jsonInput   = gson.get().fromJson(input, IJsonInput.class);
        tx.success();
      }

      if (securityContext != null) {
View Full Code Here

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

      }

      if (securityContext != null) {

        // isolate resource authentication
        try (final Tx tx = app.tx()) {

          resource = ResourceHelper.applyViewTransformation(request, securityContext,
              ResourceHelper.optimizeNestedResourceChain(ResourceHelper.parsePath(securityContext, request, resourceMap, propertyView,
              config.getDefaultIdProperty()), config.getDefaultIdProperty()), propertyView);
          authenticator.checkResourceAccess(request, resource.getResourceSignature(), propertyView.get(securityContext));
View Full Code Here

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

        boolean retry = true;
        while (retry) {

          if (resource.createPostTransaction()) {

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

              for (JsonInput propertySet : jsonInput.getJsonInputs()) {

                results.add(resource.doPost(convertPropertySetToMap(propertySet)));
              }
View Full Code Here

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

        // set default value for property view
        propertyView.set(securityContext, config.getDefaultPropertyView());

        // isolate write output
        try (final Tx tx = app.tx()) {

          if (!results.isEmpty()) {

            final RestMethodResult result = results.get(0);
            final int resultCount         = results.size();
View Full Code Here

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

        }

      } else {

        // isolate write output
        try (final Tx tx = app.tx()) {

          new RestMethodResult(HttpServletResponse.SC_FORBIDDEN).commitResponse(gson.get(), response);
          tx.success();
        }
View Full Code Here

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

      if (StringUtils.isBlank(input)) {
        input = "{}";
      }

      // isolate input parsing (will include read and write operations)
      try (final Tx tx = app.tx()) {
        jsonInput   = gson.get().fromJson(input, IJsonInput.class);
        tx.success();
      }

      if (securityContext != null) {
View Full Code Here

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

      }

      if (securityContext != null) {

        // isolate resource authentication
        try (final Tx tx = app.tx()) {

          // evaluate constraint chain
          resource = ResourceHelper.applyViewTransformation(request, securityContext,
            ResourceHelper.optimizeNestedResourceChain(ResourceHelper.parsePath(securityContext, request, resourceMap, propertyView,
              config.getDefaultIdProperty()), config.getDefaultIdProperty()), propertyView);
View Full Code Here

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

        // isolate doPut
        boolean retry = true;
        while (retry) {

          try (final Tx tx = app.tx()) {
            result = resource.doPut(convertPropertySetToMap(jsonInput.getJsonInputs().get(0)));
            tx.success();
            retry = false;

          } catch (DeadlockDetectedException ddex) {
View Full Code Here

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

            retry = true;
          }
        }

        // isolate write output
        try (final Tx tx = app.tx()) {
          result.commitResponse(gson.get(), response);
          tx.success();
        }

      } else {
View Full Code Here

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

        }

      } else {

        // isolate write output
        try (final Tx tx = app.tx()) {
          result = new RestMethodResult(HttpServletResponse.SC_FORBIDDEN);
          result.commitResponse(gson.get(), response);
          tx.success();
        }
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.