Does Laminas-Db provide a mechanism to detect implicit commits during DDL execution?
0 reputation · 10 Mar 2023, 11:29 UTC
Transactional DDL Behavior
Laminas-Db utilizes a Connection interface to manage transactions via beginTransaction(), commit(), and rollback(). These methods act as wrappers for the underlying PDO driver. However, many relational database engines, such as MySQL, trigger an implicit commit when Data Definition Language (DDL) statements are executed, which prevents a subsequent rollback from reverting schema changes.
Cross-Platform Consistency
Because transactional DDL support varies by RDBMS—where PostgreSQL allows it but MySQL does not—applications relying on the Laminas-Db adapter may experience inconsistent state recovery during failed migrations or schema updates.
Which strategies can be implemented within the Laminas-Db abstraction layer to identify if a transaction has been implicitly committed by the database engine? Is there a documented way to verify the current transaction status after a schema modification before attempting a rollback?