Skip to content

Warning when EnableTransactionManagement has lower precedence than EnableMethodSecurity #17665

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yybmion
Copy link
Contributor

@yybmion yybmion commented Aug 5, 2025

Adds validation to ensure @EnableTransactionManagement has higher precedence than @EnableMethodSecurity, allowing proper transaction rollback when @PostAuthorize fails.

  • Warn when transaction management has same or lower precedence than method security
  • Add comprehensive test coverage for various precedence scenarios

Fixes #17544

…ableMethodSecurity

Warns when transaction management has same or lower precedence to prevent
issues with @PostAuthorize rollback on methods with side effects.

Fixes: spring-projects#17544

Signed-off-by: yybmion <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 5, 2025
@jzheaux jzheaux added status: blocked An issue that's blocked on an external project change and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 11, 2025
@jzheaux
Copy link
Contributor

jzheaux commented Aug 11, 2025

Thanks for this PR, @yybmion. I'm having some internal conversations with the Framework team about this, so I'd like to hold off on this warning for the moment. I'll post my findings here.

@jzheaux jzheaux self-assigned this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked An issue that's blocked on an external project change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider warning when EnableTransactionManagement has lower precedence than EnableMethodSecurity
3 participants