Clarify recommendation on self-injection for legitimate use cases (e.g. @Transactional re-entrant calls) #28299
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: documentation
A documentation task
Milestone
Hi,
It is becoming harder and harder to use self-injection:
There are probably more small issues like this. However, unlike more general dependency cycles, self-injection seems to be considered a legitimate strategy for some use cases (e.g.
@Transactional
,@Cacheable
re-entrant calls ) by many.spring-projects/spring-boot#27652 (comment) recommended to raise an issue to the framework team.
Is there an official documented strategy and list of legitimate use cases for self-injection ? #27534 (comment) for example recommends
@Lazy
.Or are there other implementation strategies that can be used to replace self-injection in these use cases?
My personal interest is purely reentrant calls from service beans on
@Transactional
methods.This issue could be used to track documentation fixes to clarify these common use cases.
Thanks in advance
The text was updated successfully, but these errors were encountered: