snippetMinor
How to troubleshoot orm queries interfering with other applications
Viewed 0 times
troubleshootwithormapplicationsinterferinghowqueriesother
Problem
Well, it's hypothetical scenario but what I'm trying to understand is the path to go from a post-morten log (say, an SQL Server Profiler trace) to identify the code on a ORM situation. To make it not too vague, consider an scenario like that:
So, in that scenario, what is the common path to a DBA (which is also an VB.Net developer) make from the log to diagnosing which code(s) (in this case, Linq queries) are creating the trouble?
In this case, the app is ok but is affecting other apps response time using the same DB/server.
That would be absurdly different from a Java+Hiberate process?
EDIT: I want to understand the path from the trace to the culprit metaquery. If the app have SQL in it, this means that an "Find in Files" session (maybe with some regex, in extreme cases) could reduce the inspect task' targets to some dozen suspects instead of tenths or even hundreds of source files.
Using an ORM, how to get to that stage using an ORM (in this case: EF)?
- SQL Server 2008
- Entity Framework as a ORM
So, in that scenario, what is the common path to a DBA (which is also an VB.Net developer) make from the log to diagnosing which code(s) (in this case, Linq queries) are creating the trouble?
In this case, the app is ok but is affecting other apps response time using the same DB/server.
That would be absurdly different from a Java+Hiberate process?
EDIT: I want to understand the path from the trace to the culprit metaquery. If the app have SQL in it, this means that an "Find in Files" session (maybe with some regex, in extreme cases) could reduce the inspect task' targets to some dozen suspects instead of tenths or even hundreds of source files.
Using an ORM, how to get to that stage using an ORM (in this case: EF)?
Solution
I would strongly suggest metadata in the connection in order to trace back to the application. In the connection string, there is an Application Name. There is also session data which can be used in the form of CONTEXT_INFO
https://stackoverflow.com/questions/323494/sql-server-modifying-the-application-name-property-for-auditing-purposes
Of course all this requires application changes, but it is good for tracing and auditing in general, so baking it in from the beginning is really useful.
https://stackoverflow.com/questions/323494/sql-server-modifying-the-application-name-property-for-auditing-purposes
Of course all this requires application changes, but it is good for tracing and auditing in general, so baking it in from the beginning is really useful.
Context
StackExchange Database Administrators Q#25461, answer score: 6
Revisions (0)
No revisions yet.