We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27519
    • 275 Posts
    Is it possible to do transactions in xPDO?
      MODx Revolution / MAMP / OS X
      • 3749
      • 24,544 Posts
      Quote from: skndn60 at Oct 09, 2010, 06:51 PM

      Is it possible to do transactions in xPDO?

      Yes, but I believe it uses the PDO transactions.

      $modx->beginTransaction();
      $modx->rollback();
      $modx->commit();
      
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 27519
        • 275 Posts
        Thanks. I read about Tx in PDO but wasn’t sure about xPDO...
          MODx Revolution / MAMP / OS X
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          xPDO is an extension of PDO, so you should be able to do anything PDO has. xPDO just adds more.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 6228
            • 249 Posts
            Well that is good to know.

            But does that mean that xPDO transactional functionality requires transaction-safe database tables, i.e. InnoDB?
              lo9on.com

              MODx Evolution/Revolution | Remote Desktop Training | Development
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I would imagine so; the database still has to be able to support the functionality.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 27519
                • 275 Posts
                Quote from: cyclissmo at Oct 10, 2010, 11:05 AM

                Well that is good to know.

                But does that mean that xPDO transactional functionality requires transaction-safe database tables, i.e. InnoDB?

                Which means that for add-ons/components with their own db tables and a tx-requirement you will need InnoDB tables.

                What if you want to incorporate MODx core entities in tx’s....

                With phpmyadmin you easily change the storage engine of any table to InnoDB via the "Operations" tab, so I suppose you can change the required tables to InnoDB. If I understand the MySQL manual correctly you can even do this for an actively running database. Pretty cool....
                  MODx Revolution / MAMP / OS X