mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Adding the specified count to the semaphore would cause it to exceed its maximum count. #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm getting an error during dispose (using a using statement)

The error: Adding the specified count to the semaphore would cause it to exceed 
its maximum count.

        protected List<T> ExecuteBuildObjects<T>(string CommandText, System.Data.CommandType CommandType, Func<System.Data.Common.DbDataReader, T> Builder, params System.Data.IDbDataParameter[] Parameters)
        {
            var Output = new List<T>();

            using (var cn = CreateConnection())
            {
                cn.Open();
                using (var cmd = CreateCommand(CommandText, CommandType, cn, Parameters))
                using (var dr = cmd.ExecuteReader())
                    while (dr.Read())
                    {
                        var obj = Builder(dr);
                        Output.Add(obj);
                    }
            }//Error Here

            return Output;
        }

CreateConnection returns a wrapped SQLclient Connection
CreateCommand calls 
((MvcMiniProfiler.Data.ProfiledDbConnection)Connection).CreateCommand()

Original issue reported on code.google.com by XerS...@gmail.com on 27 Jun 2011 at 9:54

GoogleCodeExporter commented 8 years ago
can anyone repro this? 

Original comment by sam.saff...@gmail.com on 25 Jul 2011 at 8:21

GoogleCodeExporter commented 8 years ago
I fixed this a while back, the profiling engine is now forgiving to shipping 
commands from one thread to another.

Original comment by sam.saff...@gmail.com on 15 Aug 2011 at 1:10