title: MySQL Transaction: One Large Transaction against Multiple Small Transactions
body: <p>The design for the Big Transaction..</p>
  
  <pre><code>START TRANSACTION;
      /*
          INERT for login detail
      */
      /*
          INSERT for personal information
      */
      /*
          INSERT for user's transaction account
      */
  COMMIT; 
  </code></pre>
  
  <p>and the design for the Small Transactions..  </p>
  
  <pre><code>START TRANSACTION;
      /*
          INSERT for login detail
      */
  COMMIT;
  
  START TRANSACTION;
      /*
          INSERT for personal information
      */
  COMMIT;
  
  START TRANSACTION;
      /*
          INSERT for user's transaction account
      */
  COMMIT;  
  </code></pre>
  
  <p><strong>Current results</strong>  </p>
  
  <ul>
  <li><p>I have tried both in our application, and by using the 'Big' transaction we experienced deadlock in a certain table.  </p></li>
  <li><p>By using the small transactions, there's a chance that one or two of the three may not run and cause discrepancy.  </p></li>
  </ul>
  
  <p>My experience in handling such cases is not sufficient to provide the best solution in this kind of scenario. What kind of solution can be made here?</p>