Package org.structr.core.app

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


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

        try (final Tx tx = app.tx()) {
          result = resource.doDelete();
          tx.success();
          retry = false;

        } catch (DeadlockDetectedException ddex) {
View Full Code Here


          retry = true;
        }
      }

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

    } catch (FrameworkException frameworkException) {
View Full Code Here

      // evaluate constraints and measure query time
      double queryTimeStart    = System.nanoTime();

      // 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);
View Full Code Here

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

        try (final Tx tx = app.tx()) {
          result = resource.doGet(sortKey, sortDescending, pageSize, page, offsetId);
          tx.success();
          retry = false;

        } catch (DeadlockDetectedException ddex) {
View Full Code Here

      if (accept != null && accept.contains("text/html")) {

        final StreamingHtmlWriter htmlStreamer = new StreamingHtmlWriter(this.propertyView, indentJson, config.getOutputNestingDepth());

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

          response.setContentType("text/html; charset=utf-8");

          try (final Writer writer = response.getWriter()) {
View Full Code Here

      } else {

        final StreamingJsonWriter jsonStreamer = new StreamingJsonWriter(this.propertyView, indentJson, config.getOutputNestingDepth());

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

          response.setContentType("application/json; charset=utf-8");
          try (final Writer writer = response.getWriter()) {

            jsonStreamer.stream(securityContext, writer, result, baseUrl);
View Full Code Here

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

      // 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);
View Full Code Here

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

        try (final Tx tx = app.tx()) {
          resource.doGet(sortKey, sortDescending, pageSize, page, offsetId);
          tx.success();
          retry = false;

        } catch (DeadlockDetectedException ddex) {
View Full Code Here

      }

      final App app = StructrApp.getInstance(securityContext);

      // 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

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

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

          result = resource.doOptions();
          tx.success();
          retry = false;
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.