-
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
@EnableTransactionManagement proxyTargetClass not control by spring.aop.proxyTargetClass #8434
Comments
This was changed in 1.4 (see #5423). We've generally found cglib proxies less likely to cause unexpected cast exceptions. |
Sorry, I misunderstood your initial comment. You're saying you add |
yes,@snicoll know this question,https://github.com/Dreampie/spring-boot-demo |
the I noticed this during introducing Spring Boot into a project which used quite a lot of |
While we're working on it, we may want to share that thing in its own auto-configuration and order that in a sensible manner, see #8587 |
Previously to this commit, transaction management was only enabled when a `DataSource` is configured. The processing of `@Transactional` annotations are now enabled as long as a `PlatformTransactionManager` is present. Also, the `spring.aop.proxy-target-class` is now honoured if set, still defaulting to CGLIB mode. Closes spring-projectsgh-8434
@philwebb I've worked on a solution in b20dff1 that is a bit larger than what is foreseen here. I am not sure if that belongs to 1.4 but a couple of thoughts:
I think that 1. is pretty bad because we won't be able to change it in 1.4 or 1.5 and currently we're doing that effectively as soon as you use |
if use
@Transactional
,and setspring.aop.proxyTargetClass=false
, this class also create by cglib not jdk proxy,you must config@EnableTransactionManagement(proxyTargetClass=false)
to use jdk proxy with@Transactional
And
@EnableTransactionManagement
proxyTargetClass default value is false, why spring boot change to true?The text was updated successfully, but these errors were encountered: