public function commit() {
        if ($this->dialect) {
            $dialect = $this->dialect;
            if ($dialect->inTransaction()) {
                $this->transLevel -= 1;
                if ($this->transLevel > 0) {
                    return true;
                }
                try {
                    if ($this->commitType == 'rollback') {
                        $dialect->rollBack();

                        //提交失败，因为在提交之前有人要回滚.
                        return false;
                    } else {
                        return $dialect->commit();
                    }
                } catch (\PDOException $e) {
                    $this->error = $e->getMessage();
                } finally {
                    $this->transLevel = 0;
                    $this->commitType = null;
                }
            }
        }

        return false;
    }
public function commit() {
        if ($this->dialect) {
            $dialect = $this->dialect;
            if ($dialect->inTransaction()) {
                $this->transLevel -= 1;
                if ($this->transLevel > 0) {
                    return true;
                }
                try {
                    if ($this->commitType == 'rollback') {
                        $dialect->rollBack();

                        //提交失败，因为在提交之前有人要回滚.
                        return false;
                    } else {
                        return $dialect->commit();
                    }
                } catch (\PDOException $e) {
                    $this->error = $e->getMessage();
                } finally {
                    $this->transLevel = 0;
                    $this->commitType = null;
                }
            }
        }

        return false;
    }
public function commit ( ) { if ( $ this -> dialect ) { $ dialect = $ this -> dialect ; if ( $ dialect -> inTransaction ( ) ) { $ this -> transLevel -= 1 ; if ( $ this -> transLevel > 0 ) { return true ; } try { if ( $ this -> commitType == 'rollback' ) { $ dialect -> rollBack ( ) ; //提交失败，因为在提交之前有人要回滚. return false ; } else { return $ dialect -> commit ( ) ; } } catch ( \ PDOException $ e ) { $ this -> error = $ e -> getMessage ( ) ; } finally { $ this -> transLevel = 0 ; $ this -> commitType = null ; } } } return false ; }
commit a transaction


@return bool
commit a transaction