Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16733

Unnecessary proxying with MethodMapTransactionAttributeSource

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.0.6, 5.1 RC1
    • Component/s: Core:AOP
    • Labels:
    • Last commented by a User:
      true

      Description

      The changes for in b5922f75 means that now unnecessary objects are proxied.

      MethodMapTransactionAttributeSource now uses now uses ReflectionUtils.getAllDeclaredMethods which means that when something like addTransactionalMethod("sample.Foo.*", ...) is invoked, all the methods (including the methods on Object) are added to the transactionAttributeMap.

      Then when a method from Object is queried on any class (i.e. MethodMapTransactionAttributeSource.getTransactionAttribute(finalizeMethod,JdbcTemplate.class)) the result is true, so every object ends up getting proxied.

      A complete example of the issue can be seen at https://github.com/rwinch/spring-aop-proxy-issue/blob/master/src/test/java/sample/ProxyTests.java

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              rwinch Rob Winch
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 23 weeks, 6 days ago