return connection pool with/whthout using block
Posted: Tue 20 Jan 2015 05:55
If the connection pool is enable,what the situation if the connection object out of using block? return to pool or auto dispose(if dispose, is meaning disconnect server actually?)
1. with using block
2.without using block
1. with using block
Code: Select all
void connect()
{
using (var pgSqlConnection = new PgSqlConnection(pgCSB.ConnectionString))
{
pgSqlConnection.Open();
pgSqlConnection.Close();
}
}
Code: Select all
void connect()
{
var pgSqlConnection = new PgSqlConnection(pgCSB.ConnectionString);
pgSqlConnection.Open();
pgSqlConnection.Close();
}