I'm unsure at which level the connection pool is implemented in .NET. When I call
using(var connection = new SqlConnection(connectionString))
{
connection.Open();
Am I surely opening a new connection? Or could I possibly be reusing an active connection? The connection pool present in SqlConnection can be absent in other DbConnection implementations?
Connection pooling happens automatically, unless you specify otherwise. If you scroll down to the section "Controlling Connection Pooling with Connection String Keywords" in the first link below, you'll see that the default for "pooling" is true.
http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx
Connection pools get created without any intervention by you, as long as the connection string is exactly the same (uppercase/lowercase matters in this point.)
The same can be said for the OleDbConnection and Connection Pooling.
http://msdn.microsoft.com/en-us/library/ms254502.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With