<p>Is it necessary or advantageous to write custom connection pooling code when developing applications in .NET with an SQL Server database?  I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it?  Why do people talk about writing their own connection pooling software and how is this different than what's built into ADO.NET?</p>

[{'answer_id': 8229, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 2, 'selected': False, 'text': '<p>My understanding is that the connection pooling is automatically handled for you when using the SqlConnection object. This is purposefully designed to work with MSSQL and will ensure connections are pooled efficiently. You just need to be sure you close them when you are finished with them (and ensure they are disposed of).</p>\n\n<p>I have never heard of people needing to roll their own myself. But I admit my experience is kind of limited there.</p>\n'}, {'answer_id': 8231, 'author': 'Vaibhav', 'author_id': 380, 'author_profile': 'https://Stackoverflow.com/users/380', 'pm_score': -1, 'selected': False, 'text': '<p>Well, it is going to go away as the answer to all these questions will be LINQ. Incidentally, we have never needed custom connection pooling for any of our applications, so I am not sure what all the noise is about.</p>\n'}, {'answer_id': 8232, 'author': 'Sean Carpenter', 'author_id': 729, 'author_profile': 'https://Stackoverflow.com/users/729', 'pm_score': 5, 'selected': True, 'text': '<p>The connection pooling built-in to ADO.Net is robust and mature.  I would recommend against attempting to write your own version.</p>\n'}, {'answer_id': 8235, 'author': 'Chris Roberts', 'author_id': 475, 'author_profile': 'https://Stackoverflow.com/users/475', 'pm_score': 2, 'selected': False, 'text': "<p>I'm no <em>real</em> expert on this matter, but I know ADO.NET has its own connection pooling system, and as long as I've been using it it's been faultless.</p>\n\n<p>My reaction would be that there's no point in reinventing the wheel... Just make sure you close your connections when you're finished with them and everything will be fine!</p>\n\n<p>I hope someone else can give you some more firm anwers!</p>\n"}, {'answer_id': 8584, 'author': 'BinaryMisfit', 'author_id': 146270, 'author_profile': 'https://Stackoverflow.com/users/146270', 'pm_score': 1, 'selected': False, 'text': '<p>With the advent of ADO.Net and the newer version of SQL connection pooling is handled on two layers, first through ADO.Net itself and secondly by SQL Server 2005/2008 directly, eliminating the need for custom connection pooling. </p>\n\n<p>I have been informed that similar support are being planned or have been implemented in Oracle and MySQL out of interest.</p>\n'}]
['https://Stackoverflow.com/questions/8223', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/72/']