Today i found out there is a sql connection leak in ExtendSaveProductCatedories.
This caused by creating a loop over all products and calling Product.Save()
Please have a look at the following dw source:
--------------------------------------------------------------
Dynamicweb.eCommerce.Products.Product
private void ExtendSaveProductCatedories(bool skipExtendedSave)
.....
if (!skipExtendedSave)
{
Hashtable productCategoriesLanguageControl = this.GetProductCategoriesLanguageControl();
IDbConnection connection = Database.CreateConnection();
....
--------------------------------------------------------------
The var connection is never closed, disposed or in a using statement.
The previous connection dbConnection is in a nice using statement. Can't you reuse that one?
Can you fix this please?
Workaround:
Call Product.Save(false); If you do not need updating of EcomProductCategoryFieldValue
Some background info. During development this was not noticed because some how the number of cpu's is also affecting the number of leaking sql connections. The server which i was rolling out today has 24 cores and the number of sql connections jumped to the limit of 200.
Why is the pool so large. Shouldn't this be configurable?