spring-projects / spring-projects/spring-security

Spring @Transactional Annotation in MODE.AspectJ does not work anymore after adding spring-security-aspects

Open
#19,177 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: bug
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

See this very small project reproducing the error:

https://github.com/kicktipp/annotationorder/

I am using AspectJ compile-time-weaving for @Async and @Transactional Annotations. I have lots of methods having both annotations and the order of execution is always correct.

Now I added spring-security-aspects to the build.gradle.kts and suddenly the @Transactional is not recognized anymore. It still works with jakarta @transactional

I have no idea how this can happen. But it looks like a bug to me.

Spring team said I should report it here
Reference: https://github.com/spring-projects/spring-boot/issues/50431#issuecomment-4448219156

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the small reproducer at github.com/kicktipp/annotationorder and inspect its build.gradle.kts, especially the addition of spring-security-aspects. Run the project to compare AspectJ compile-time weaving for Spring @Transactional with jakarta @Transactional when methods also use @Async. Done means the Spring annotation is recognized again with spring-security-aspects present and the annotation order still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.