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

Remove @Transactional from static entity methods, e.g. findEntity(Long id), findAll(), etc

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2.0.RELEASE, 1.2.1.RELEASE, 1.2.2.RELEASE
    • None
    • GENERAL OBJECTS
    • All environments

    Description

      Presently, Spring does not support @Transactional on static methods (See https://jira.springsource.org/browse/SPR-5999). Therefore, the annotations do not serve a purpose.

      Also, from what I understand about Entity Managers, once a transaction is complete, the object becomes detached. Detached entities do not have access to data store resources. Therefore, if the Spring teams at some point allow @Transactional on static methods, you will not be able to load entity relationships after calling the find method. The entity will be detached. I may be wrong on this point since I don't fully understand Entity Managers.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:

              Time Tracking

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