Anybody had any success in profiling their Subsonic sql queries with MvcMiniProfiler? I can't seem to find exactly where in Subsonic to hook into the SqlConnection creation process.
Profiling Subsonic SQL with MvcMiniProfiler
166 Views Asked by pwhe23 At
1
There are 1 best solutions below
Related Questions in SUBSONIC3
- Subsonic race condition detected each new DB connection
- Some values in LINQ Query Statement aren't saved correctly to class with subsonic 3
- Select some columns instead of select * with SubSonic 3
- System.Data.SqlClient.SqlException (0x80131904): Timeout expired occured after i update the stored procedure
- Index was outside of bounds of the array
- Calling Method in Subsonic 3.0 ActiveRecord Query
- About SubSonic 3 (ActiveRecord) Queries
- Can't decide which property to consider the Key - you can create one called 'ID' or mark one with SubSonicPrimaryKey attribute
- Subsonic 3 Saving into different databases
- warning Multiple directives found
- How to use SubSonic 3.0.4 with ASP.NET Web Forms Website?
- Subsonic 3.0.0.4 leaking SQL connections?
- sql query speed issue is this normal
- How do you change SubSonic 3's connection string on the fly?
- LINQ to Subsonic Left Outer Join
Related Questions in MVC-MINI-PROFILER
- How to clean up Miniprofiler old data?
- Store MiniProfiler results in PostgreSQL
- MiniProfiler .Ignore() extension method does not disable profiling
- InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography.Pkcs'
- Start MiniProfiler UI minimized?
- MiniProfiler ASP.NET MVC5 not able to get results
- Mini-profiler does not show any statistics on sql queries?
- Getting "Not Found" error with mini profiler in ASP.NET Core with EF .net 5
- MiniProfiler ASP.NET Core - ShouldProfile based on user role
- ormlite async methods throw casting exception with miniprofiler
- When using MiniProfilter to wrap DbConnection, receive error Procedure or function 'X' expects parameter '@Y', which was not supplied
- MiniProfiler MVC SQL Timings Not Displaying
- where to see the SQL query time?
- Integrate MiniProfiler with .NetCore 3.1
- Miniprofiler (Asp.net Core) Using sessionStorage for Basic Auth
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I never did find a really great way to do this, but I did find something that worked. I couldn't subclass the SubSonic.DataProviders.DbDataProvider class since the constructor was "internal" (not awesome). So I just copied the source code into my project and made a few changes.
The main line of code that has to be changed is in the "CreateConnection" method, it needs to return a ProfiledDbConnection.
Since the Connection is no longer a SqlConnection so this caused a casting error in some of the existing code. To fix these I changed the "ExecuteDataSet" method to use the Connection from the scope instead of the factory.
I also changed the "ExecuteScalar" method to use the scope Connection.
Everything seems to be working now. I am currently using IOC to determine whether the database class itself uses this ProfilingDbDataProvider or the existing DbDataProvider. I changed this in the code generation of the Context class to pull from IOC instead of using the ProviderFactory.
Hope that helps someone else.