Extend NHibernate DriverConnectionProvider class
I am working on an old web application. It extended DriverConnectionProvider
NHibernate to establish a db connection. Below is the code.
public class NewConnectionProvider : DriverConnectionProvider
{
public override System.Data.IDbConnection GetConnection()
{
IDbConnection conn = base.GetConnection();
//execute a SP here.. to set up proxy user to connect to
//oracle db
return conn;
}
}
//connection string
<add name="connname" connectionString="Data Source=(DESCRIPTION =(ADDRESS_LIST = (ADDRESS =
(PROTOCOL = TCP)(HOST = .....)(PORT = ....)))(CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = ....)));Min Pool Size=5;Max Pool Size=500;Proxy User Id=....;
Proxy Password=.....;Validate Connection=True;Connection Timeout=100;" />
Question: The problem we are facing is that the number of connections is related to the Max Pool Size
connection string. Sometimes we get a connection timeout error. How does joining join work in this case? Do I need to override as well DriverConnectionProvider.CloseConnection
? If so, when do I need to call? The system uses NHibernate, Oracle 11g.
source to share
A message appears stating that the connection is never closed. You probably need to implement,
public void CloseConnection(IDbConnection connection)
in your ConnectionProvider. More details
source to share