[Svn-src-all:4281] [version-2_13-dev 23195] #2370 トランザクション処理の前にトランザクションの状態を確認する

pineray admin @ mail.ec-cube.net
2013年 9月 9日 (月) 10:54:12 JST


Subversion committed to /home/svn/open 23195
http://svn.ec-cube.net/open_trac/changeset/23195
┌────────────────────────────┐
│更新者 :  pineray                                      │
│更新日時:  2013-09-09 10:54:12 +0900 (月, 09  9月 2013)│
└────────────────────────────┘

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

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_13-dev/data/class/SC_Query.php

変更: branches/version-2_13-dev/data/class/SC_Query.php
===================================================================
--- branches/version-2_13-dev/data/class/SC_Query.php	2013-09-09 01:25:12 UTC (rev 23194)
+++ branches/version-2_13-dev/data/class/SC_Query.php	2013-09-09 01:54:12 UTC (rev 23195)
@@ -200,7 +200,11 @@
      */
     public function commit()
     {
-        return $this->conn->commit();
+        if ($this->inTransaction()) {
+            return $this->conn->commit();
+        } else {
+            return false;
+        }
     }
 
     /**
@@ -211,7 +215,11 @@
      */
     public function begin()
     {
-        return $this->conn->beginTransaction();
+        if (!$this->inTransaction()) {
+            return $this->conn->beginTransaction();
+        } else {
+            return false;
+        }
     }
 
     /**
@@ -222,7 +230,11 @@
      */
     public function rollback()
     {
-        return $this->conn->rollback();
+        if ($this->inTransaction()) {
+            return $this->conn->rollback();
+        } else {
+            return false;
+        }
     }
 
     /**




Svn-src-all メーリングリストの案内