How To Determine If A Transaction Is Alive


I have this method that does some AR handling. I want to enforce that this method and any "parent" methods that call it, which always changes AR records as well (the parents are action methods) - all do it transactionally.

In other words, I want to check the transaction status at some arbitrary section in my code.

Currently the only solution I’ve found and that seems ok is to use CDbConnection.getCurrentTransaction().

Is there a better way?

Other words of wisdom on the subject?


I think this is indeed your best chance.