Magento 2 – Asymmetric transaction rollback error

You may also like...

3 Responses

  1. Marek says:

    I do not see edit possibility so moderator can delete 1st message.
    I have import script which loads data from xml and saves it as product in magento2 shop. My script imported more than 7000 products and now it throws me this error. This is happening during $_product->save(). Awkward is that It adds product to my shop but somewhere after that breaks my script with error. Tried with solution in this post but don’t work for me. One more thing, same script throws error on remote server but not on local (don’t have so much products on local – if it is important). Still trying to resolve this issue but if you have any ideas I will be grateful.

    • magemaster says:

      Have you tried my suggested solution to change /vendor/magento/framework/DB/Adapter/Pdo/Mysql.php? I’m not 100% sure why this happens, but it has to do with MySQL settings. It seems as if they are different on your local system and remote. MySQL doesn’t support rollbacks. The question is: why it needs to rollback your transaction. I discovered it too on product import. Sometimes it happens, sometimes not. Reason for this may be a 2nd running task on database which locks tables or a timeout from database. A deeper investigation would be grateful.

      • Marek says:

        @magemaster “Have you tried my suggested solution to change /vendor/magento/framework/DB/Adapter/Pdo/Mysql.php?” – I’m magento2 beginner and do not feel worthy to change core 🙂 i tried something but without results.
        I found solution it seems there is something wrong with indexres (at least in my case). In Admin Panel > System > Index Management I changed mode for each index to “update by schedule” and import is working now.

Leave a Reply