Showing posts with label connections. Show all posts
Showing posts with label connections. Show all posts

Monday, March 12, 2012

Reusing package configuration in child packages

I currently have multiple (parent and child) packages using the same config file. The config file has entries for connections to a number of systems. All of them are not used from the child packages. Hence, my child package throws an error when it tries to configure using the same config file because it can't find the extra connections in my connection collection.

Does anyone have any ideas on the best way to go about resolving this? Is multiple config files (one for each connection) the only way?

Sachin

I have found that one file per connection is ultimately the best way to go. You may be able to have more than that, if you are sure you will always use the same configurations at the same time, but that seems to be more useful when you have some variables, perhaps a couple of file paths used for all of your packages to do logging or check pointing, but you need to be careful of not falling into the same trap again of over grouping. Keep it at the lowest level you can, it is just more flexible I have found, and copes better with change as well. (Deleted Post?)

|||

Darren

Looks like that might very well be the way to go then. I wonder if there is any way to include other config files into a single file, but that's for another day.

Thanks for the prompt reply.

Sachin

|||

Nice idea, support for XML Inclusions (XInclude) would do it (http://www.w3.org/TR/xinclude/).

One for MS Connect I think - http://connect.microsoft.com

Friday, March 9, 2012

Reusing connections

Every time my asp.net app needs to open a connection, it tries to establish a new connection with the mssql server. I′ve already set the max pool size property in the connection string. After that, my app raises an "time out"error saying it couldn′t obtain a connection from the pool. The problem is that I have a lot of iddle connections. With the Enterprise Manager I can see the status of the connections. They′re all the same "awaiting command". How can I reuse this connections? I know that the connection string must be the same for all connections and it is. I′ve set it in the web.config file. If I remove the max pool size property from the connection string I get a lot, I mean A LOT of connections with the sql server. Any ideas?

You should be ensuring that all connections get closed using a try/catch/finally block. Also, take a look at the following articles:

Tuning Up ADO.NET Connection Pooling With ASP.NET Applications
ASP.NET and SQL Server Performance Tips
The .NET Connection Pool Lifeguard

HTH