# java:S6809 false-negative with @Transactional class-level annotation

**URL:** <https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788>\
**Category:** Report False-positive / False-negative...\
**Tags:** spring, java\
**Created:** [January 16, 2026, 2:55pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788 "2026-01-16T14:55:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liszka](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Liszka](https://community.sonarsource.com/u/Liszka)\
**Post date:** [January 16, 2026, 2:55pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/1 "2026-01-16T14:55:25Z")

</div>

The rule does not activate when one Transactional annotation is used on class level instead of individual public methods. From the functional point of view, such use of Transactional annotation is equivalent but Sonar does not report anything in this scenario.

Generally the code still may work but the rule should detect the violation of correct Spring bean coding practices anyway. Please note that adding another (unused) method with an explicit Transactional annotation to the class source code causes SonarQube for IDE to start detecting incorrectly java:S2229 instead.

```auto
package com.jpa.demo.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(propagation = Propagation.REQUIRES_NEW)
public class DemoServiceImpl {
    
    public void firstTransactionalMethod() {
        
        // call another public transactional method in the wrong way
        // - this is not detected by java:S6809
        separateTransactionalMethod();
        
        // do something in my own transaction
    }

    public void separateTransactionalMethod() {
        // do something else in a separate transaction
    }

    //@Transactional(propagation = Propagation.SUPPORTS)
    //public void separateTransactionalMethod2() {
    // // do something else
    //}
}

```

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [January 20, 2026, 5:53pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/2 "2026-01-20T17:53:41Z")

</div>

Hi,

Can you give your context for this? You’ve said SonarQube for IDE. Can you provide flavor and version?

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![Liszka](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Liszka](https://community.sonarsource.com/u/Liszka)\
**Post date:** [January 22, 2026, 8:07pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/3 "2026-01-22T20:07:20Z")

</div>

CONFIDENTIAL (by Asseco CE)

Hello Ann  
The version of SonerQube for IDE in IntelliJ IDEA was 11.6.0.83783.  
The demonstration source code provided should be sufficient to reproduce the issue by any Java programmer who can write Spring Boot code.  
I know that the use case might seem to be complex, however Spring configuration is very often done using annotations, not only on methods but also on classes (and elsewhere). So, working rules for Java code using Spring need to be ready not only for the simplest use case, otherwise the programmers will not rely on them.  
Best Regards  
Matej Liszka

---

<div class="post-metadata">

**Author:** ![Liszka](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Liszka](https://community.sonarsource.com/u/Liszka)\
**Post date:** [January 22, 2026, 8:09pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/4 "2026-01-22T20:09:13Z")

</div>

Hello Ann  
The version of SonarQube for IDE in IntelliJ IDEA was 11.6.0.83783.  
The demonstration source code provided should be sufficient to reproduce the issue by any Java programmer who can write Spring Boot code.  
I know that the use case might seem to be complex, however Spring configuration is very often done using annotations, not only on methods but also on classes (and elsewhere). So, working rules for Java code using Spring need to be ready not only for the simplest use case, otherwise the programmers will not rely on them.  
Best Regards  
Matej Liszka

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [January 23, 2026, 1:59pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/5 "2026-01-23T13:59:14Z")

</div>

Hi Matej,

The current version of SonarQube for IntelliJ (formerly SonarLint) is 11.11. Can you upgrade and see if this is still replicable?

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![Liszka](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Liszka](https://community.sonarsource.com/u/Liszka)\
**Post date:** [January 23, 2026, 2:21pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/6 "2026-01-23T14:21:04Z")

</div>

CONFIDENTIAL (by Asseco CE)

Hello Ann  
I am not a tester of SonarQube rules 🙂 I will come back to it maybe later on. Thank you for understanding. To be honest, I am really surprised as I expected that my input would be used by the team that maintains commercial products of Sonar. This answer is really disappointing, especially for potential customers of Sonar…  
Best Regards, Matej

---

<div class="post-metadata">

**Author:** ![Liszka](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Liszka](https://community.sonarsource.com/u/Liszka)\
**Post date:** [January 23, 2026, 2:22pm UTC](https://community.sonarsource.com/t/java-s6809-false-negative-with-transactional-class-level-annotation/172788/7 "2026-01-23T14:22:00Z")

</div>

Hello Ann  
I am not a tester of SonarQube rules 🙂 I will come back to it maybe later on. Thank you for understanding. To be honest, I am really surprised as I expected that my input would be used by the team that maintains commercial products of Sonar. This answer is really disappointing, especially for potential customers of Sonar…  
Best Regards, Matej
