fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15321] booking: add transaction


From: sigurdne
Subject: [Fmsystem-commits] [15321] booking: add transaction
Date: Thu, 23 Jun 2016 08:41:32 +0000 (UTC)

Revision: 15321
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15321
Author:   sigurdne
Date:     2016-06-23 08:41:31 +0000 (Thu, 23 Jun 2016)
Log Message:
-----------
booking: add transaction

Modified Paths:
--------------
    trunk/booking/inc/class.socommon.inc.php

Modified: trunk/booking/inc/class.socommon.inc.php
===================================================================
--- trunk/booking/inc/class.socommon.inc.php    2016-06-23 08:36:50 UTC (rev 
15320)
+++ trunk/booking/inc/class.socommon.inc.php    2016-06-23 08:41:31 UTC (rev 
15321)
@@ -641,6 +641,7 @@
                {
                        $values = 
$this->marshal_field_values($this->get_table_values($entry, __FUNCTION__));
 
+                       $this->db->transaction_begin();
                        $this->db->query('INSERT INTO ' . $this->table_name . ' 
(' . join(',', array_keys($values)) . ') VALUES(' . join(',', $values) . ')', 
__LINE__, __FILE__);
                        $id = $this->db->get_last_insert_id($this->table_name, 
'id');
                        foreach ($this->fields as $field => $params)
@@ -699,6 +700,9 @@
                                        }
                                }
                        }
+
+                       $this->db->transaction_commit();
+
                        $receipt['id'] = $id;
                        $receipt['message'][] = array('msg' => lang('Entity %1 
has been saved', $receipt['id']));
                        return $receipt;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]