jameshong
(Jameshongbiz333)
1
Hello, anyone know how to deal with embed transaction?
e.g.
transactionA->begin()
// do something
transactionB->begin()
// do something
transactionB->commit()
transactionA->commit()
now is getting error, said "There is already an active transaction"
Thanks in advance!
redguy
(Maciej Lizewski)
2
there is no nested transactions support in PDO, and Yii is using PDO as DB abstraction layer…
what you can do is detect if you are in transaction and use it or create one if not already in transaction, or implement something similar to: http://www.kennynet.co.uk/2008/12/02/php-pdo-nested-transactions/
which is some workaround…