At the heart of Petapoco.cs there is the function OpenShareConnection. I believe this cannot take advantage of the Connection Pool in SQL Azure. I am monitoring my connections and the connection count grows above the pool limit.
Anyone has done some improvements?
Here is the OpenShareConnection (from Petapoco open source):
public void OpenSharedConnection()
{
if (_sharedConnectionDepth == 0)
{
//read the connection string from web.config and
//create a new connection
_sqlConnection = _factory.CreateConnection();
_sqlConnection.ConnectionString = _connectionString;
// Wrap this method with a retry policy.
_sqlConnection.Open();
_sqlConnection = OnConnectionOpened(_sqlConnection);
if (KeepConnectionAlive)
_sharedConnectionDepth++; // Make sure you call Dispose
}
_sharedConnectionDepth++;
}