Skip to content

Unnecessary proxying with MethodMapTransactionAttributeSource [SPR-16733] #21274

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions