title: How To use service methods inside typeorm transactions
body: <p>I have read about transactions in typeorm. </p>
  
  <pre><code>@Transaction()
  save(user: User, @TransactionRepository(User) userRepository: Repository&lt;User&gt;) {
      return userRepository.save(user);    
  }
  </code></pre>
  
  <p>I have a nestjs application with multiple modules and services. what i need to do is call different service methods inside a transaction. but <code>@TransactionRepository</code> provides me with the <code>repository</code>. So what should i do to achieve a transaction with multiple service methods being called inside it. like </p>
  
  <pre><code>class Module3Service{
      constructor(
      private readonly module1service: Moudle1Service,
      private readonly module2service: Module2Service
      ){}
  
      @Transaction()
      save() {
          this.module1service.create()
          this.module2service.create()
      }
  </code></pre>
  
  <p>I don't know how to achieve it. and also correct me if I am wrong that a possible solution is to change the moduleservice dependencies ( module1service dependency => module1repositoroy) to change to our new repository instance that we get from <code>@TransactionRepository(Module1Enity) module1repository: Repository&lt;Module1Entity&gt;</code> inside the tranction method. or any other solution please help</p>
  
  <p>I am using postgres</p>