title: node.js: Creating a transaction that covers calls to more than one repository
body: <p>I'm used to code using C# and sometimes I create transactions that have more than one call to different repositorys, and if one that calls fails, the rollback covers every repository.</p>
  
  <p>The code is like this:</p>
  
  <pre><code>using (var scope = new TransactionScope())
  {
      itemRepository.deleteItems(items);
      bookRepository.deleteBooks(books);
      scope.Complete();
  }
  </code></pre>
  
  <p>This ensures that if an error occurs on bookRepository, the deleted items will be on the rollback.</p>
  
  <p>Now, I'm trying to do the same thing using node.js.
  I found the <a href="https://www.npmjs.com/package/mssql" rel="nofollow">mssql</a> package that has the option to create transactions, but only inside the repository, like this:</p>
  
  <pre><code>var transaction = new sql.Transaction(/* [connection] */);
  transaction.begin(function(err) {
  // ... error checks 
  
  var request = new sql.Request(transaction);
      request.query('insert into mytable (mycolumn) values (12345)', function(err, recordset) {
          // ... error checks 
  
          transaction.commit(function(err, recordset) {
              // ... error checks 
  
              console.log("Transaction committed.");
          });
      });
  });
  </code></pre>
  
  <p>So, there's some way to create a transaction on the Service that covers more than one repository like I described?</p>