title: Multiple database transaction
body: <p>In my PHP application ( constructed using symfony framework and Propel ORM), when I add a record to the MYSQL database, I need to update an external MYSQL database using web service API provided by the external vendor.</p>
  
  <p>The question is what is the best practice to maintain the database integrity. Take for example, if the first update is successful, and the second update is not, due to the fact that web service isn't available, I must be able to either</p>
  
  <ol>
  <li>Rollback the transaction for the first update, or</li>
  <li>cache the call to the web services and keep calling to the web services until the services become available</li>
  <li>Some other techniques that can maintain the multiple database integrity.</li>
  </ol>
  
  <p>Specifically, I am looking for syntax like</p>
  
  <pre><code>void RootMethod()
  {
       using(TransactionScope scope = new TransactionScope())
       {
          try
           { 
            SomeMethod();
            scope.Complete();
            CallWebService();
           }
           catch
           {
               scope.abort();
            }
       }
  }
  </code></pre>
  
  <p>But not sure whether</p>
  
  <ol>
  <li>This is a good technique</li>
  <li>Or is this feasible in symfony as in C#</li>
  </ol>
  
  <p>What do you think?</p>
  
  <p><strong>Edit:  Some asked me why there is a need for two part update. It's because I am creating a front end application connecting to an existing back end application. And I don't want to change the back end application. So inevitably there will be some overlap. Therefore there is a need to synch the data</strong></p>
  
  <p><strong>Another Edit: The two parts transaction must be done together, doing a cron job to synchronize the table is not desirable</strong></p>