-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use @EnableTransactionManagement(proxyTargetClass = true) #5423
Comments
I don't think that's the only one that's involved here. |
Switching it on by default shouldn't have any side-effects, especially since cglib is repackaged as part of Spring anyway. |
Unfortunately it has :(. See SPR-14322 for details. |
@olivergierke Looks like SPR-14322 isn't going to be fixed in 4.x. I'm still tempted to leave |
I have a web project that uses Spring and needed to make a batch module for it so I decided to go with Spring Boot and reused my services module from the bigger project. The services module has a ton of final methods and does not go well with cglib and it took me 2 days to understand and fix why cglib proxies where being used despite the fact that all services implemented interfaces. I also tried changing spring.aop.proxy-target-class in properties but it was ignored (#8434). It seems to me that changing the default was a bad call. It breaks a well known behavior of Spring. |
This commit documents the change to the default value for spring.aop.proxy-target-class by clarifying when the default is true vs false. Fixes spring-projectsgh-5423
This commit documents the change to the default value for spring.aop.proxy-target-class by clarifying when the default is true vs false. Fixes spring-projectsgh-5423
We should use
@EnableTransactionManagement(proxyTargetClass = true)
to prevent nasty proxy issues when people aren't using interfaces.The text was updated successfully, but these errors were encountered: