ZF-8063: Attempting to nest transactions in adapters that do not support it should fail explicitly
When using PDO based adapters an exception will be thrown(by PDO) if you attempt to nest transactions on backends that does not support it. Other adapters, like Mysqli, simply ignore subsequent calls to beginTransaction(), and commit everything each time commit is called.
I think all adapters should adopt the behavior exposed by PDO. The semantics of the API (beginTransaction(), commit(), and rollback()) indicate that it is possible to nest transactions. If this is not the case the adaptor should throw an exception to let the developer know that it is not possible to nest transactions.
The Zend_Db_Adapter API hides the semantics of the underlying database functions that indicate that it is not possible to nest transactions, therefore it should communicate this information in another way.
This change may be considered a BC break. The API of Zend_Db_Adapter is not changed, but the behavior of some adapters(the ones hiding the limitations of the underlying backend) is. Code depending on the adapter not throwing an exception would break.