I'm wondering whether the following message is provided only in case there is MaxPoolSize exceeded or it could also be related with a problem of getting the connection from the DB.
if (Connector == null) { if (Connection.Timeout > 0) { throw new Exception("Timeout while getting a connection from pool."); } else { throw new Exception("Connection pool exceeds maximum size."); } }
Does a mechanism provided by Francisco (logging the stack trace at which connection has been opened and hasn't been closed correctly) still exists in npgsql logging mechanism? How the logger should be configured to receive this information in the newest npgsql version?
Hi, Milosz!
I just finished a patch for master branch which adds support for connection pool tracking.
You can have a look at it here:
https://github.com/franciscojunior/Npgsql/commit/9143798dd93b9eba625d157eef54a5be9ccc2542
It is in the branch add-connection-pool-tracking branch: https://github.com/franciscojunior/Npgsql/commits/add-connection-pool-tracking
Please, let me know if it works OK for you. I was thinking about improving this feature by adding an NpgsqlDiagnostics class which would provide information about Npgsql internals.
Let me know if you have any ideas for improvements.
Thanks in advance!
NpgsqlEventLog.LogName = "NpgsqlTests.LogFile";