This problem below is something I am encoutering after some custom code and play with the database:
[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
Dynamicweb.Database.CreateConnection(String database) +3234
Dynamicweb.Content.Items.Activation.ActivationManager.CreateDatabaseBuilder() +138
Dynamicweb.Content.Items.Queries.Repository..ctor(ItemType metadata) +83
Dynamicweb.Content.Items.Queries.StorageFactory.CreateRepository(ItemType metadata) +34
Dynamicweb.Content.Items.Queries.StorageManager.Open(ItemType metadata) +21
Dynamicweb.Content.Items.Queries.StorageManager.Open(String systemName) +70
Dynamicweb.Content.Items.Queries.StorageManager.GetByPageId(String systemName, Int32 pageId) +103
What I am doing is this:
- Using itempublisher to fetch item-pages based on an boolean item value.
- Loop through each page
-
using (var command = Dynamicweb.Database.CreateConnection().CreateCommand()){ to fetch all item paragraphs on the page
-
Dynamicweb.Content.Items.ItemManager.Storage.GetById(item_type, item_id) to get the item and its content
- if its an itemlist I am again contacting the database to get the independant items from that itemlist by a custom sql
using (var command2 = Dynamicweb.Database.CreateConnection().CreateCommand()){
This seems to create an issue with the database. Any way this can be done better to achieve the same.
regards