Is it possible to do transactions in xPDO?
MODx Revolution / MAMP / OS X
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();
Thanks. I read about Tx in PDO but wasn’t sure about xPDO...
MODx Revolution / MAMP / OS X
-
☆ 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.
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
-
☆ A M B ☆
- 24,524 Posts
I would imagine so; the database still has to be able to support the functionality.
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