rollBack() public method

Rollback the active database transaction.
public rollBack ( integer | null $toLevel = null ) : void
$toLevel integer | null
return void
 /**
  * @param mixed $id
  * @param DomainEventStream $eventStream
  */
 public function append($id, DomainEventStream $eventStream)
 {
     $id = (string) $id;
     //Used to thrown errors if ID will not cast to string
     $this->db->beginTransaction();
     try {
         foreach ($eventStream as $domainMessage) {
             $this->insertEvent($domainMessage);
         }
         $this->db->commit();
     } catch (QueryException $ex) {
         $this->db->rollBack();
         throw $ex;
     }
 }