title: Is good practice to inject Transactional service to another transactional service in Spring?
body: <p>I'm in consternation. I found posts about inject <code>@Service</code> class to another <code>@Service</code> class. But what if the both classes have <code>@Transactional</code> annotation? <code>@Transactional</code> makes a difference or maybe better practise is inject repositories?</p>
  <p>Simple exmaple:</p>
  <pre><code>@Transactional
  @Service
  public class BBBServiceImpl implements BBBService {
      
      private final BBBRepository bbbRepository;
  
      // @Autowired constructor, methods etc...
      
  }
  </code></pre>
  <p>second class:</p>
  <pre><code>@Transactional
  @Service
  public class AAAServiceImpl implements AAAService {
  
      private final AAARepository aaaRepository;
      private final BBBService bbbService;
      
      @Autowired
      public AAAServiceImpl(AAARepository aaaRepository, BBBService bbbService) {
          this.aaaRepository = aaaRepository;
          this.bbbService = bbbService;
      }
  
      // methods etc...
  }
  </code></pre>
  <p>Or better solution is:</p>
  <pre><code>@Transactional
  @Service
  public class AAAServiceImpl implements AAAService {
  
      private final AAARepository aaaRepository;
      private final BBBRepository bbbRepository;
      
      @Autowired
      public AAAServiceImpl(AAARepository aaaRepository, BBBRepository bbbRepository) {
          this.aaaRepository = aaaRepository;
          this.bbbRepository= bbbRepository;
      }
  
      // methods etc...
  
  }
  </code></pre>