I have been using MYSQL NET connector 5.x for a long time, Recently i upgraded my project with MYSQL 8.0.35 and connector with MYSQL 8.3.0. Every thing works fine except opening multiple connections in threaded environment gives "Unable to Connect to Any of the Specified MySQL Hosts" after 12 threads.

And IIS app pool hangs after that.

The flow was simple .

   Open the connection
    
   Process

   Close the connection 

The above code will be called in loop for multiple time and in multi threading environment.

The same code works very well in old connector with out a single issue.

 Public Shared Function pustest(ByVal busid As Integer) As String
        Dim d As New pustest_Delegate(AddressOf pustest1)
        Dim R As IAsyncResult = Nothing
        R = d.BeginInvoke(busid, Nothing, Nothing)
 End Function

 Private Delegate Sub pustest_Delegate(ByVal busid As Integer)
    Private Shared Function pustest1(ByVal busid As Integer) As String
        Dim con As MySqlConnection
        Dim str As String = "insert into tblins(bid, dte) values('" & busid & "','" & dbnow(0).DB_yyyyMMdd_HHmmss & "')"
        con = dcon1(myConfig.DB)
        dbcommand(str, con)
        Dim sd As String = busid
        con.Close()
  End Function


Calling Part:

Dim ik As Integer = 1
            While ik < 15000
                pustest(ik)
             
                Response.Write("<br>" & dbnow(0).DS_ddMMMyyyy_hhmm_tt & " - " & ik & " - " & sval & "<br>")
                ik = ik + 1
 End While
0

There are 0 best solutions below