Import script can't save pricing

Hi Mark,
why would the quoted line return false? I mean for some csv lines it does create a product so that line returns true and I can get id of a new product but sometimes it can return false. This is something related to bad data for product, right? In my case product title is the same for several lines but just weight and price are different, so I am unsure how to find an issue… is there a way to catch any error from method: public function savePricing(ItemPricingInterface $pricing) or a better approach you would suggest? :pray:
The issue is that manually looking through the massive csv lines does not help to identify any inconsistency :crazy_face:

it looks like MODX logged error:

INSERT INTO `xxxxx_commerce_product` (`class_key`, `sku`, `barcode`, `name`, `description`, `price`, `pricing`, `stock`, `s...............0, 0, 0)
    [0] => HY000
    [1] => 2014
    [2] => Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

The error is fairly clear. You need to look at why there is a buffered query. Perhaps you’re trying to process this within a $modx->getIterator() loop?

Hi Mark,
you are right it is not too clear especially when I just found same error in the MODX log when just general pages get loaded. Do you think I should post the hosting? :innocent:

PS. I have also agreed the it could be that my php code is breaking the iteration of fetch the data but I have double checked my code and can’t confirm it’s doing it… I will PM you my code if you do not mind just for double check, OK? :pray:

OK, $stmt->closeCursor(); needed to be executed before any other $stmt start