rollback() public method

Rollback changes in a transaction.
public rollback ( $savepoint = NULL ) : void
return void
示例#1
0
 public final function run()
 {
     $this->dibiConnection->begin();
     try {
         parent::run();
     } catch (\Exception $e) {
         $this->dibiConnection->rollback();
         throw $e;
     }
     $this->dibiConnection->commit();
 }
示例#2
0
 public function migrate(AbstractMigration $migration)
 {
     $this->connection->begin();
     try {
         if (!$this->hasSchemaTable()) {
             $this->getAdapter()->createSchemaTable();
             $this->hasSchemaTable = true;
         }
         $migration->run();
         $this->getAdapter()->log($migration, time());
     } catch (\Exception $e) {
         $this->connection->rollback();
         throw $e;
     }
     $this->connection->commit();
 }
示例#3
0
 public function rollback()
 {
     $this->db->rollback();
 }