Hello, according to the documentation, to allow package-private or protected methods to benefit from @Transactional we have to register custom transactionAttributeSource. Previous statement based on Method visibility and @Transactional in https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative/annotations.html

I found that for class-based proxies I can add @Transational over package-private or protected methods without any additional action or registering specific @Bean mentioned in the documentation. Observation while using Spring Framework version 6.0.8. I assume that it may work by default from version 6.0 M1 according to https://github.com/spring-projects/spring-framework/issues/25582?fbclid=IwAR3CgK1Qn1qDd0GPYfWE5gMj18L2g8RCeUUfNeYNWjTKIcgUPfLKT7Tt6ks

The issue is created to encourage change in documentation. Currently, whatever article we may find about @Transactional, or a tool like SonarLint, each says it's necessary to have a public method to use it. It seems to me that most of them are no longer current 😸 If we have in documentation something more precise, like mentioning that for class-based proxies it's just ok to use @Transactional above package-private or protected method, but for interface-based not, it would be much more clear to understand and use. It would allow to increase the encapsulation in the projects.

Thanks.