Changeset:
        c60d8c5c28c8
        
https://sourceforge.net/p/mrbs/hg-code/ci/c60d8c5c28c80a2263cb135da902fd07cfdb35e1
Author:
        Campbell Morrison <[email protected]>
Date:
        Mon Sep 26 18:34:36 2016 +0100
Log message:

Restored calls to mrbs_ignore_user_abort() around transactions.

diffstat:

 web/lib/MRBS/DB.php       |  18 ++++++++++++++++++
 web/lib/MRBS/DB_mysql.php |   2 ++
 web/lib/MRBS/DB_pgsql.php |   2 ++
 3 files changed, 22 insertions(+), 0 deletions(-)

diffs (66 lines):

diff -r 5041e5f5208c -r c60d8c5c28c8 web/lib/MRBS/DB.php
--- a/web/lib/MRBS/DB.php       Mon Sep 26 17:41:56 2016 +0100
+++ b/web/lib/MRBS/DB.php       Mon Sep 26 18:34:36 2016 +0100
@@ -183,6 +183,20 @@
   }
 
   
+  public function begin()
+  {
+    // This method must be extended by the sub-classes, which must call the 
parent as the
+    // first thing they do.   It only exists here in the parent class in order 
that all the
+    // calls to mrbs_ignore_user_abort() are grouped together.
+    
+    // Turn off ignore_user_abort until the transaction has been committed or 
rolled back.
+    // See the warning at 
http://php.net/manual/en/features.persistent-connections.php
+    // (Only applies to persistent connections, but we'll do it for all cases 
to keep
+    // things simple)
+    mrbs_ignore_user_abort(TRUE);
+  }
+  
+  
   // Commit (end) a transaction. See begin().
   function commit()
   {
@@ -192,6 +206,8 @@
     {
       trigger_error ($this->error(), E_USER_WARNING);
     }
+    
+    mrbs_ignore_user_abort(FALSE);
   }
 
   
@@ -204,6 +220,8 @@
     {
       trigger_error ($this->error(), E_USER_WARNING);
     }
+    
+    mrbs_ignore_user_abort(FALSE);
   }
 
 
diff -r 5041e5f5208c -r c60d8c5c28c8 web/lib/MRBS/DB_mysql.php
--- a/web/lib/MRBS/DB_mysql.php Mon Sep 26 17:41:56 2016 +0100
+++ b/web/lib/MRBS/DB_mysql.php Mon Sep 26 18:34:36 2016 +0100
@@ -35,6 +35,8 @@
   // improve performance for multiple insert/delete/updates.
   public function begin()
   {
+    parent::begin();
+    
     $result = $this->command("START TRANSACTION");
   
     if ($result < 0)
diff -r 5041e5f5208c -r c60d8c5c28c8 web/lib/MRBS/DB_pgsql.php
--- a/web/lib/MRBS/DB_pgsql.php Mon Sep 26 17:41:56 2016 +0100
+++ b/web/lib/MRBS/DB_pgsql.php Mon Sep 26 18:34:36 2016 +0100
@@ -67,6 +67,8 @@
   // improve performance for multiple insert/delete/updates.
   public function begin()
   {
+    parent::begin();
+    
     $result = $this->command("BEGIN");
   
     if ($result < 0)

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to