Changeset 23195


Ignore:
Timestamp:
2013/09/09 10:54:12 (11 years ago)
Author:
pineray
Message:

#2370 トランザクション処理の前にトランザクションの状態を確認する

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/class/SC_Query.php

    r23124 r23195  
    201201    public function commit() 
    202202    { 
    203         return $this->conn->commit(); 
     203        if ($this->inTransaction()) { 
     204            return $this->conn->commit(); 
     205        } else { 
     206            return false; 
     207        } 
    204208    } 
    205209 
     
    212216    public function begin() 
    213217    { 
    214         return $this->conn->beginTransaction(); 
     218        if (!$this->inTransaction()) { 
     219            return $this->conn->beginTransaction(); 
     220        } else { 
     221            return false; 
     222        } 
    215223    } 
    216224 
     
    223231    public function rollback() 
    224232    { 
    225         return $this->conn->rollback(); 
     233        if ($this->inTransaction()) { 
     234            return $this->conn->rollback(); 
     235        } else { 
     236            return false; 
     237        } 
    226238    } 
    227239 
Note: See TracChangeset for help on using the changeset viewer.