Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: Next Major Release
-
Fix Version/s: None
-
Component/s: Zend_Db_Adapter_Mysqli
-
Labels:None
Description
I noticed if you nest transactions, if the inner transaction commits but the outer transaction rolls back, the changes take effect and ZF does not throw any exceptions or handle that nicely. It appears from this thread (http://codeigniter.com/forums/viewthread/82771/) that CI has a feature that makes it so only the outer commit/rollback takes effect.
This prevented me from testing code that uses Zend_Db & transactions, because my test itself needed to rollback any changes that happened during the test. But the code I was testing had it's own beginTransaction() and commit()
I guess in code ignitor that inner commit() would be ignored.
Possible patch is attached. The $_should_emulate_nesting flag which defaults to false will retain it's current behavior. Setting the flag to true mimics code ignitor's feature (which makes my green bar happy)