When generating a data layer on a database with 200+ tables we noticed that Visual Studio would freeze, crash and never complete the transformation. Upon further investigation we found that the freeze was occurring due to the ADO.NET connection pool running out of available connections, which seemed to cause the template transformation process to wait for an available connection. A work around for this issue is to add the "Max Pool Size" attribute to your connection string and set the number above the default of 100.
We patched this issue in our environment by changing the following methods so that they do not use the GetReader or GetCommand methods to open SQL connections:
LoadTables
LoadColumns
LoadFKTables
GetPK
Instead, the methods listed above instantiate the SQL connection, command, and data reader from within the method.
When generating a data layer on a database with 200+ tables we noticed that Visual Studio would freeze, crash and never complete the transformation. Upon further investigation we found that the freeze was occurring due to the ADO.NET connection pool running out of available connections, which seemed to cause the template transformation process to wait for an available connection. A work around for this issue is to add the "Max Pool Size" attribute to your connection string and set the number above the default of 100.
We patched this issue in our environment by changing the following methods so that they do not use the GetReader or GetCommand methods to open SQL connections:
Instead, the methods listed above instantiate the SQL connection, command, and data reader from within the method.