Why is this an issue?

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.

How to fix it

Make the method public or remove the @Transactional annotation.

Code examples

Noncompliant code example

@Transactional  // Noncompliant
void doTheThing(ArgClass arg) {
  // ...
}

@Transactional  // Noncompliant
private void doTheOtherThing(ArgClass arg) {
  // ...
}

Compliant solution

@Transactional
public void doTheThing(ArgClass arg) {
  // ...
}

private void doTheOtherThing(ArgClass arg) {
  // ...
}