// A transaction after a DDL statement should still work the same.
$this->cleanUp(); $transaction = $this->connection->startTransaction(); $transaction2 = $this->connection->startTransaction(); $this->executeDDLStatement(); unset($transaction2); $transaction3 = $this->connection->startTransaction(); $this->insertRow('row'); $transaction3->rollBack(); unset($transaction3); unset($transaction); $this->assertRowAbsent('row');
// The behavior of a rollback depends on the type of database server.
if($this->connection->supportsTransactionalDDL()){ // For database servers that support transactional DDL, a rollback
// of a transaction including DDL statements should be possible.
$this->cleanUp(); $transaction = $this->connection->startTransaction(); $this->insertRow('row'); $this->executeDDLStatement(); $transaction->rollBack(); unset($transaction);