kepazon / mvc-mini-profiler

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

SQL Statements are occasionally attached to the wrong profiler result when multiple requests occur simultaneously #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Make multiple AJAX requests simultaneously each making a different SQL query 
over a Profiled Connection.

What is the expected output? What do you see instead?
I would expect each AJAX request to have the relevant SQL query attached to the 
profiler output for that request. 

Instead, I see some requests have "2 Sql" with the SQL for another request 
included. The *other* request has no associated SQL statements so it looks like 
the profiler is getting confused about which statements happened on what AJAX 
request. (sometimes a request will end up with "3 SQL" and there will be 2 
requests without any SQL even though each request has exactly 1 SQL statement 
associated.)

There is a project that demonstrates this problem that I originally created for 
issue http://code.google.com/p/mvc-mini-profiler/issues/detail?id=43 - 
downloadable from that link.

What version of the product are you using? On what operating system?
v1.6 (with additional patches to fix the issue documented at 
http://code.google.com/p/mvc-mini-profiler/issues/detail?id=43)
Windows 7 64-bit with SQL 2005 as database server

Original issue reported on code.google.com by randomse...@gmail.com on 25 Jul 2011 at 11:34

GoogleCodeExporter commented 9 years ago
Just committed a fix, this is pretty interesting EF reuses commands fairly 
early on ... it seems it has a pool of commands and checks out prior to running 
then checks back in after it gets the results. 

Original comment by sam.saff...@gmail.com on 26 Jul 2011 at 12:33

GoogleCodeExporter commented 9 years ago
Fantastic! Interesting it was such a small fix in the end too.

And you'll be pleased to hear I've not found any more bugs - this works great 
with EF now, as far as I can tell :)

Really good job, thanks a lot!

Original comment by randomse...@gmail.com on 26 Jul 2011 at 8:25