subsonic / SubSonic-3.0-Templates

T4 Template Project for the peeps
http://subsonic.github.io/
105 stars 46 forks source link

Connections being left open during template transformation. #26

Open tombatron opened 15 years ago

tombatron commented 15 years ago

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.