Marking a non-`public` method `@Transactional` is both useless and misleading because Spring does not recognize non-`public` methods, and so makes no provision for their proper invocation.
Nor does Spring make provision for the methods invoked by the method it called.
Therefore marking a `private` method, for instance, `@Transactional` can only result in a runtime error or exception if the method is annotated as `@Transactional`.
=== on 27 Nov 2018, 13:06:43 Semyon Danilov wrote:
\[~ann.campbell.2] Actually, any method can be Transactional if you're using AspectJ compiler, it's stated in the docs https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html[here]. The excerpt:
----
Method visibility and @Transactional
When using proxies, you should apply the @Transactional annotation only to methods with public visibility. If you do annotate protected, private or package-visible methods with the @Transactional annotation, no error is raised, but the annotated method does not exhibit the configured transactional settings. Consider the use of AspectJ (see below) if you need to annotate non-public methods.