Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-298

@Transactional (AspectJ) and @Configurable not weaved for @Entity if this @Entity is managed by a JpaRepository

    Details

    • Sprint:
      The Road To SpringOne

      Description

      I am load-time weaving aspects to advice program elements with @Transactional and @Configurable.

      When trying to use Spring's @Transactional annotation on a JpaRepository-managed @Entity, then this entity is not advised with transactional semantics.

      Also, when trying to use Spring's @Configurable annotation to inject domain objects with Spring-managed beans, this mechanism fails when such domain objects are of an @Entity type managed by a JpaRepository.

      Notice that both observations happen with load-time weaving (jvm argument: -javaagent:"path/to/.m2/repository/org/springframework/spring-instrument/3.2.1.RELEASE/spring-instrument-3.2.1.RELEASE.jar"). I haven't tried compile-time weaving.

      Attached to this issue you find a minimal JUnit test case, fully Spring @Annotation-based. Comment-toggle the @EnableJpaRepositories annotation to make the test case successful (but of course, then it's missing the JpaRepository). Start it up with above mentioned -javaagent argument.

      Relevant Spring 3.2.x documentation:
      http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/aop.html#aop-ajlib-other
      http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/transaction.html#transaction-declarative-aspectj

        Attachments

          Activity

            People

            • Assignee:
              thomasd Thomas Darimont
              Reporter:
              abdull Gerrit Hübbers
              Last updater:
              Jens Schauder
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: