R11 SR1 delete products in batch
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
R11 SR1 delete products in batch
We have a client who is trying to delete products in a batch from Catalog/Browse and keeps getting the error below if they try to delete 50 at a time- I had to use Elmah error logging to capture it. I was able to test and sometimes it worked, sometimes it didn't. I tested with 20 on a page and it did those products OK, even if they were included in the batch of 50 that failed. They have a few of the products that are in more than one category, if that is any help.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: R11 SR1 delete products in batch
Does it work if they use the delete multiple function from the Product Manager?
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: R11 SR1 delete products in batch
We tested on their live site and their dev site. We selected a category in the product manager and there were 921 products. We changed the page to show 50. We checked the box to check all and didn't expand to do all the products. Selected delete and clicked and nothing happened, they weren't deleted, no error was shown.
I just tried it again at 20 per page of the 921 products and put logging code in and it said it was deleting them but didn't.
I was able to delete products from categories that had fewer products.
Thanks
I just tried it again at 20 per page of the 921 products and put logging code in and it said it was deleting them but didn't.
I was able to delete products from categories that had fewer products.
Code: Select all
public static bool DeleteProducts(int[] productIds)
{
List<string> ids = new List<string>();
IDatabaseSessionManager database = AbleContext.Current.Database;
database.BeginTransaction();
foreach (int pid in productIds)
{
ProductDataSource.Delete(pid);
Logger.Warn("Line 123 deleting " + pid.ToString());
}
database.CommitTransaction();
return true;
}
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: R11 SR1 delete products in batch
Unfortunately, I don't have easy access to a R11 install right now, but here are a couple things you can look for.
- try getting a result set that DOESN'T trigger the paging and the fancy script that allows you to select from multiple pages.
- is it getting hung up on products that are assigned to multiple categories, or that have digital goods or subscriptions?
I just don't have a clue on where to start looking, or why your logging code isn't working. But, maybe it would help if there were a little more info about the products that are being deleted.
Thanks
Katie
- try getting a result set that DOESN'T trigger the paging and the fancy script that allows you to select from multiple pages.
- is it getting hung up on products that are assigned to multiple categories, or that have digital goods or subscriptions?
I just don't have a clue on where to start looking, or why your logging code isn't working. But, maybe it would help if there were a little more info about the products that are being deleted.
Thanks
Katie
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: R11 SR1 delete products in batch
I tested on a local R11 site of mine after getting the products from the problem site and ran into the same problem. On both the browse and ManageProducts page, the error is thrown at database.CommitTransaction(). I commented out the transaction code and was able to delete OK. Some of the products are in two categories, if that helps. I had the display size set to 50 products.
I've attached an image of debugging on the Browse page.
I've attached an image of debugging on the Browse page.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: R11 SR1 delete products in batch
Hi Judy,
I am going to try and setup a Gold install so I can test this. Give me a few days though...
Thanks
Katie
I am going to try and setup a Gold install so I can test this. Give me a few days though...
Thanks
Katie
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: R11 SR1 delete products in batch
Katie,
I can give you access to a dev site to test it, but I'm not sure that doing that or your setting up a site would help. There are reports of similar errors on Google and it seems to be that somehow the session gets out of sync with what is in the database and it's pretty elusive. One of the recommendations was to open a new session, but I'm not sure I can do that in the code since AC controls the session. Right now after taking the transaction code off, the merchant is able to delete 50 several times before he runs into a problem. Then he can delete more the next day. I just put code in to wrap each delete in a transaction to see if that helps. It's not the best way to do it, but it might get him by.
I can give you access to a dev site to test it, but I'm not sure that doing that or your setting up a site would help. There are reports of similar errors on Google and it seems to be that somehow the session gets out of sync with what is in the database and it's pretty elusive. One of the recommendations was to open a new session, but I'm not sure I can do that in the code since AC controls the session. Right now after taking the transaction code off, the merchant is able to delete 50 several times before he runs into a problem. Then he can delete more the next day. I just put code in to wrap each delete in a transaction to see if that helps. It's not the best way to do it, but it might get him by.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx