You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unnecessary proxying with MethodMapTransactionAttributeSource [SPR-16733] #21274
The changes for in b5922f75 means that now unnecessary objects are proxied.
MethodMapTransactionAttributeSource now uses now usesReflectionUtils.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.
Good point, this was just meant as a convenience for interface refactorings where methods happened to move to a super-interface. I'm afraid I forgot to consider ".*" patterns...
I'll simply revert to the previous implementation then and adapt the corresponding test case to explicitly refer to the super-interface. Whenever extracting a parent interface, people will simply have to adapt their method pattern the same way (as before).
Activity
spring-projects-issues commentedon Apr 17, 2018
Juergen Hoeller commented
Good point, this was just meant as a convenience for interface refactorings where methods happened to move to a super-interface. I'm afraid I forgot to consider ".*" patterns...
I'll simply revert to the previous implementation then and adapt the corresponding test case to explicitly refer to the super-interface. Whenever extracting a parent interface, people will simply have to adapt their method pattern the same way (as before).
spring-projects-issues commentedon Apr 18, 2018
Rob Winch commented
Thanks for the fast turnaround. I can confirm that the latest SNAPSHOTs have fixed the issue.