Hello Friends,
In this blog we will try to understand what exactly ADO.NET/ Entity Framework connection pooling is? And we will also go through some important points related to connection pooling. So lets start with few basic:--
What is connection Pooling ?
Connection pooling means onces the connection object is opened, after that rather then going and recreating the connection object again and again, the ado.net/EF takes the connection string and puts the connection string in a pooler. In this pooler the connection object will be the cached and later if some buddy open connection again then it will take connection from pool.
Connection establishing process diagram
Key Points
- Connection pooling is enabled by default in ADO.NET/EF. You can turn off connection pooling in connection string if you don't want to use it.
string ConnectionString = @"Data Source=DataSourceName;Initial Catalog=DatabaseName;Integrated Security=True";
// pooing by default enable
If you don't want to use pooling then turn off
string ConnectionString = @"Data Source=DataSourceName;Initial Catalog=DatabaseName;Integrated Security=True; Pooling=False";
0 Comment(s)