Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3210

Annotating services with @Transactional limits functionality when using Datanucleus and GAE

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0.RELEASE, 1.2.1.RELEASE, 1.2.2.RELEASE
    • Fix Version/s: None
    • Component/s: GAE, GWT
    • Environment:
      All environments

      Description

      Currently, services are annotated with @Transactional, making all methods in the corresponding class transacational (though not the ITDs). However, when using GAE, you can only act on a single entity group within a transaction, which limits functionality (At least when using GWT...I don't have experience using the other web technologies).

      Consider the following example. An application is designed to save orders. Each order has a corresponding customer which is stored separately. If you create an order and customer in the GWT application, you must create two separate requests to save each since they are in different entity groups. However, if you create a method in the service that is not transactional (which is impossible since the class itself is annotated @Transactional), you can call two transactional methods within the non-transactional method, allowing you to save both entities in the same request.

      Even though the above use case is quite specific, in general marking services as @Transactional reduces flexibility. The developer should have the option to decide which methods are transactional.

      Recommend removing the "declare @type: EntityServiceImpl: @Transactional" and simply annotating each method with @Transactional. This should resolve ROO-3203 as well.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            thor1729 Nick Thorson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - 2d
                2d
                Remaining:
                Remaining Estimate - 2d
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified