Re: MySqlException: Unable to connect to any of the specified MySQL hosts
Posted by: bronislav r
Date: June 28, 2008 06:47PM

I have that problem with MySQL 5.0.41 and .Net connector 5.2.2

The problem is, when I try to open several connections from different threads, often the calls to sqlconnection.open() result in

a) exception "Unable to connect to any of the specified MySQL hosts" if pooling=false

or

b) call never returns (hangs) if pooling = true.

The problem seems to go away if I serialize calls to conn.open() from different threads in this way:

static object lockDBObject = new object();

lock(lockDBObject)
{
conn.open();
}

Apparently there is some threading bug somewhere in .NET or in the Connector code.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySqlException: Unable to connect to any of the specified MySQL hosts
June 28, 2008 06:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.