title: Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseMySql' call
body: <p>I have an application based on F#, and I use EF-Core and MySQL (Pomelo.EntityFrameworkCore.MySql).
  I have an <code>async</code> method which updates data in DB(MySql)</p>
  <pre><code>let updatePlayerAchievementsAsync (logger:ILogger) (ctx:ReportCacheDbContext) (id: int) = async {
    let! account = ctx.AccountCaches.FirstOrDefaultAsync(fun e -&gt; e.AccountId = id) |&gt; Async.AwaitTask
    if account &lt;&gt; null then
      account.State &lt;- &quot;Closed&quot;
      do! ctx.SaveChangesAsync true |&gt; Async.AwaitTask |&gt; Async.Ignore
      logger.LogInformation(&quot;Account{0} updated&quot;, id)        
  }
  </code></pre>
  <p>when this method comes to the 99th element, the following errors occurred:</p>
  <pre><code>|ERROR|System.InvalidOperationException:An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseMySql' call. 
  ---&gt; MySql.Data.MySqlClient.MySqlException (0x80004005): Connect Timeout expired. All pooled connections are in use.
  </code></pre>
  <p>I tried to follow 1st error's recomendation and tried to add <code>EnableRetryOnFailure()</code></p>
  <pre><code>member this.ConfigureServices(services: IServiceCollection) =
      services.AddOptions() |&gt; ignore
      services.AddCors() |&gt; ignore
      
      services
          .AddDbContext&lt;ApplicationDbContext&gt;(
              fun (service:IServiceProvider) (dbContext:DbContextOptionsBuilder) -&gt;
                  dbContext.UseMySql(profile.DbConnectionToAdmin /*HERE*/)|&gt; ignore)
      ...
  </code></pre>
  <p>And I can't find any documentation about this adding options for F# &amp; MySQL, cause all found info written on C#.
  Maybe problem in used pools (default max=100) and I wrote next:</p>
  <pre><code>...
  do! ctx.SaveChangesAsync true |&gt; Async.AwaitTask |&gt; Async.Ignore
  ctx.Database.CloseConnection()
  logger.LogInformation(&quot;Account{0} updated&quot;, id)  
  </code></pre>
  <p>But anyway problem wasn't solved.
  This is my new experience in <code>F#</code> and <code>async</code> and I cant understand what I did incorrectly.
  Could anyone help me in such problem?
  Thanks a lot!</p>