Description
Rob Winch opened SPR-16733 and commented
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
Affects: 5.0.6
Issue Links:
- AspectJ execution pointcut does not detect methods in superinterface anymore [SPR-16723] #21264 AspectJ execution pointcut does not detect methods in superinterface anymore