Changeset 23440


Ignore:
Timestamp:
2014/05/23 13:41:05 (9 years ago)
Author:
pineray
Message:

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

commit と rollback を行う際にトランザクションが開始されていなければエラーとなってしまうのを回避。
begin に関しては、すでにトランザクションが開始されていれば何もしない処理がMDB2に組み込まれている。

File:
1 edited

Legend:

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

    r23378 r23440  
    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 
     
    223227    public function rollback() 
    224228    { 
    225         return $this->conn->rollback(); 
     229        if ($this->inTransaction()) { 
     230            return $this->conn->rollback(); 
     231        } else { 
     232            return false; 
     233        } 
    226234    } 
    227235 
Note: See TracChangeset for help on using the changeset viewer.