Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > ORM Profiler Section > Bugs & Issues> Should lots of connections of "Unknown" Database type indicate a potential problem
 

Pages: 1
Bugs & Issues
Should lots of connections of "Unknown" Database type indicate a potential problem
Page:1/1 

  Print all messages in this thread  
Poster Message
ccrowhurst
User



Location:
Orpington
Joined on:
04-Dec-2013 13:06:54
Posted:
9 posts
# Posted on: 02-Jul-2014 23:59:22.  
Hi,

I've been seeing quite a number of connections being disposed of with no corresponding open log entry.

These I'm guessing are generated because a DbContext is being newed up but never used to query the database with.

Is this a potential performance problem that I should be looking into to resolve? To give more of an idea of the extent of the problem: for every HTTP request to the server I'm seeing about 6 extra connections generating a dispose event with no corresponding open event.

I know that I can reduce this number to 3 if I set in web.config modules runAllManagedModulesForAllRequests="false". Ideally I would make this change, but for technical reasons if would require some amount of trial and error to avoid breaking other parts of the web app that relies on this setting. If these extra connections were not a problem, I probably will just ignore them and save some dev time.

Thanks in advance
Christian
  Top
Otis
ORM Profiler Team



Location:
The Hague, The Netherlands
Joined on:
22-Aug-2011 10:26:38
Posted:
611 posts
# Posted on: 03-Jul-2014 09:27:42.  
No this isn't a problem. The Dispose call is good, your code actively makes sure dispose is called. When DbContext instances are created, they also create a DbConnection instance. Dispose is the end of a created object and the Dispose call is thus meant to dispose the created DbConnection object. 'Open' is paired with Close, not Dispose.

So:
Create - Dispose
Open - Close

So the connection is created, but never opened (and thus not closed either) and at the end it's disposed, which is correct. Regular Smiley


Frans Bouma
ORM Profiler / LLBLGen Pro Lead Developer | Blog | Twitter
 
Top
ccrowhurst
User



Location:
Orpington
Joined on:
04-Dec-2013 13:06:54
Posted:
9 posts
# Posted on: 03-Jul-2014 10:18:00. Goto attachments  
Great, thanks for the confirmation.

One further thing. I'm trying to filter out these connections that are never opened. I've tried setting up a Filter on Database Type, picking every option except for "Unknown". This however does not appear to be filtering the collection of events.

What am I doing wrong?

Attached (hopefully) is a screen shot of the filter after I have recorded a snapshot.

Thanks
Christian
  Top
Otis
ORM Profiler Team



Location:
The Hague, The Netherlands
Joined on:
22-Aug-2011 10:26:38
Posted:
611 posts
# Posted on: 03-Jul-2014 17:38:32.  
Unfortunately, you can't filter on that. Database Type filter is for when you want to filter out connections to e.g. Oracle and are only interested in connections to SQL Server. You can't filter on connections which are created but never opened.

Frans Bouma
ORM Profiler / LLBLGen Pro Lead Developer | Blog | Twitter
 
Top
ccrowhurst
User



Location:
Orpington
Joined on:
04-Dec-2013 13:06:54
Posted:
9 posts
# Posted on: 03-Jul-2014 17:39:56.  
Ah OK, that's a real shame as there is a fair amount of noise being generated...

Can you add this as a feature request?

Thanks
Christian
  Top
Otis
ORM Profiler Team



Location:
The Hague, The Netherlands
Joined on:
22-Aug-2011 10:26:38
Posted:
611 posts
# Posted on: 04-Jul-2014 11:17:40.  
Done. Though I don't know when or if this will be added in the future.

Keep in mind that it is valuable to have the empty connections there, as it will show you if you missed a dispose call on the dbcontext Regular Smiley


Frans Bouma
ORM Profiler / LLBLGen Pro Lead Developer | Blog | Twitter
 
Top
ccrowhurst
User



Location:
Orpington
Joined on:
04-Dec-2013 13:06:54
Posted:
9 posts
# Posted on: 04-Jul-2014 11:26:50.  
Makes sense. Still would be nice though as a filer option that would be off by default.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.09082011 Final.