private function beginTransaction(IsolationLevel $level = null, AccessMode $mode = null)
 {
     $this->assertFinished();
     if (!$this->db->inTransaction()) {
         $this->db->begin($level, $mode);
     } else {
         $this->savepointName = $this->createSavepointName();
         $this->db->savepointBegin($this->savepointName);
     }
 }
Beispiel #2
0
 protected function getLink()
 {
     if (!$this->db) {
         throw new WrongStateException('Expected setted db');
     }
     if (!$this->db->isConnected()) {
         $this->db->connect();
     }
     return $this->db->getLink();
 }
Beispiel #3
0
 /**
  * @return Queue
  **/
 public function run(DB $db)
 {
     $db->queryRaw($this->toDialectString($db->getDialect()));
     return $this;
 }
Beispiel #4
0
 protected function closeTransaction()
 {
     $this->db->commit();
 }