spring-projects / spring-projects/spring-framework
@Transactional should fail in @PostConstruct if AspectJ transaction aspect not initialized yet
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Using Aspectj mode with runtime aspectj weaver.
Inside a @PostConstruct, calling a method with @Transactional doesn't start a transaction.
The transactional aspect forwards call to the method, but no transaction is started. This is an invalid behavior, I was expecting an exception.
Sample repo: https://github.com/cdalexndr/spring-boot-issue-26710
Spring Boot 2.4.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked sample repository and reproduce the behavior on Spring Boot 2.4.4 using AspectJ mode with the runtime weaver. Trace the transaction aspect during @PostConstruct initialization; done means the invalid call no longer proceeds silently and instead raises the expected exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100