title: Which MySql InnoDB Transaction Isolation Level Should I use?
body: <p>I am using the .NET MySqlClient v6.6.4.0 against a MySql Server v5.7.19</p>
  
  <pre><code>Show table Status 
  </code></pre>
  
  <p>reveals all tables are using the InnoDB engine</p>
  
  <pre><code>SHOW VARIABLES LIKE 'tx_isolation';
  </code></pre>
  
  <p>returns </p>
  
  <pre><code>tx_isolation    REPEATABLE-READ
  </code></pre>
  
  <p>My problem is simple.</p>
  
  <p>I have a single process which does the following every minute</p>
  
  <pre><code>Open a database connection
  Begin a Transaction (using default isolation mode of RepeatableRead)
  Delete all rows from a table
  Insert a bunch of rows - at least 50 or 60
  Commit transaction
  Close connection
  </code></pre>
  
  <p>I also have multiple separate processes which may query that table at any time.</p>
  
  <p>I am expecting that if the table is queried while it is being written in the scope of the transaction, the reader will block until the transaction is complete and will then get back all the 50 or 60 rows. </p>
  
  <p>What I find instead is that the reader does not block and receives whatever has been written up to that point.</p>
  
  <p>What isolation level do I need so that readers block while the table is being populated and receive a full set of data?</p>