MySQL + C# Connector / NET Bulk Operations
===

I'm currently in the process of writing a multi threaded chat service and have ran into a few error with MySql that I can't seem to find a resolution for.

I'm currently taking advantage of MySql's connection pooling using the "MySqlHelper" class:



                public User GetUser(string Email)
        {
            try
            {
                string Escape = MySqlHelper.EscapeString(Email);
                string Query = String.Format("SELECT * FROM `users` WHERE `email` = '{0}' LIMIT 1", Escape);
                using (MySqlDataReader reader = MySqlHelper.ExecuteReader(databaseLoader.connectionString.ToString(), Query))
                {
                    if (!reader.HasRows)
                    {
                        return null;
                    }
                    while (reader.Read())
                    {
                        string messages = reader["messages"].ToString();
                        var OfflineMessages = new List<UserMessagePair>();
                        if (reader["messages"].ToString() != "")
                        {
                            foreach (var msg in ListSerializer.Deserialize(messages))
                            {
                                var pair = ListSerializer.Deserialize(msg);
                                OfflineMessages.Add(new UserMessagePair(int.Parse(pair[0]), pair[1]));
                            }
                        }
                        return new User()
                                   {
                                       ID = int.Parse(reader["id"].ToString()),
                                       Email = reader["email"].ToString(),
                                       Password = reader["password"].ToString(),
                                       Nickname = reader["nickname"].ToString(),
                                       Status = reader["status"].ToString(),
                                       About = reader["about"].ToString(),
                                       Role = (Misc.Type.RoleType) Enum.Parse(typeof (Misc.Type.RoleType),
                                                                              reader["role"].ToString(),
                                                                              true),
                                       Premium = bool.Parse(reader["premium"].ToString()),
                                       Rooms = ListSerializer.Deserialize(reader["subscriptions"].ToString()),
                                       Device = (Misc.Type.DeviceType) Enum.Parse(typeof (Misc.Type.DeviceType),
                                                                                  reader["devicetype"].ToString(),
                                                                                  true),
                                       lastIPAddress = reader["ipaddress"].ToString(),
                                       uniqueID = reader["uniqueid"].ToString(),
                                       Contacts = ListSerializer.Deserialize(reader["contacts"].ToString()),
                                       CustomTag = reader["tag"].ToString(),
                                       OnlineStatus = int.Parse(reader["onlinestatus"].ToString()),
                                       Messages = int.Parse(reader["messagecount"].ToString()),
                                       LastTime = reader["lasttime"].ToString(),
                                       UserNotes = reader["notes"].ToString(),
                                       OfflineMessages = OfflineMessages,
                                       Exists = true
                                   };
                    }
                    return null;
                }
            }

            catch
            {
                return null;
            }
        }

There is really no formal error thrown - what happens is over a period of time (after 30-40 users connect) The library will just stop connecting? I think this is because of the max pool size being exceeded (I have it set to 100,000), Is there an efficient way to manage pooled connections and make sure that exceeding this does not happen, because Oracle claims on their website ( http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-connection-pooling.html ) That it automatically manages the connections for you, but this does not seem to be happening properly...

To be honest, I'm not exactly sure what is going on because no exceptions are being thrown and it simply just, doesn't work.

Has anyone ever used the connector/net on a large scale like this and ran into issues? Because I've ran into countless issues and can't seem to find a way to fix this.

Another question would be, Are there any other alternatives other than using the connector/net?

Thanks a bunch! (sorry if I was vague, I really have no idea what's going on here..)