Revision: 1334
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1334&view=rev
Author:   jberanek
Date:     2010-04-21 09:51:01 +0000 (Wed, 21 Apr 2010)

Log Message:
-----------
Added transaction support to MySQL DB abstractions

Modified Paths:
--------------
    mrbs/trunk/web/mysql.inc
    mrbs/trunk/web/mysqli.inc
    mrbs/trunk/web/pgsql.inc

Modified: mrbs/trunk/web/mysql.inc
===================================================================
--- mrbs/trunk/web/mysql.inc    2010-04-21 08:46:28 UTC (rev 1333)
+++ mrbs/trunk/web/mysql.inc    2010-04-21 09:51:01 UTC (rev 1334)
@@ -156,16 +156,18 @@
 
 
 // Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
+// improve performance for multiple insert/delete/updates.
+// There is no rollback support, since MySQL myisam tables don't support it.
 function sql_mysql_begin($db_conn = null)
 {
+  sql_mysql_command("START TRANSACTION", $db_conn);
 }
 
 
 // Commit (end) a transaction. See sql_begin().
 function sql_mysql_commit($db_conn = null)
 {
+  sql_mysql_command("COMMIT", $db_conn);
 }
 
 

Modified: mrbs/trunk/web/mysqli.inc
===================================================================
--- mrbs/trunk/web/mysqli.inc   2010-04-21 08:46:28 UTC (rev 1333)
+++ mrbs/trunk/web/mysqli.inc   2010-04-21 09:51:01 UTC (rev 1334)
@@ -163,16 +163,18 @@
 
 
 // Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
+// improve performance for multiple insert/delete/updates.
+// There is no rollback support, since MySQL myisam tables don't support it.
 function sql_mysqli_begin($db_conn = null)
 {
+  sql_mysqli_command("START TRANSACTION", $db_conn);
 }
 
 
 // Commit (end) a transaction. See sql_begin().
 function sql_mysqli_commit($db_conn = null)
 {
+  sql_mysqli_command("COMMIT", $db_conn);
 }
 
 

Modified: mrbs/trunk/web/pgsql.inc
===================================================================
--- mrbs/trunk/web/pgsql.inc    2010-04-21 08:46:28 UTC (rev 1333)
+++ mrbs/trunk/web/pgsql.inc    2010-04-21 09:51:01 UTC (rev 1334)
@@ -172,8 +172,8 @@
 
 
 // Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
+// improve performance for multiple insert/delete/updates.
+// There is no rollback support, since MySQL myisam tables don't support it.
 function sql_pgsql_begin($db_conn = null)
 {
   sql_pgsql_ensure_handle($db_conn);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

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

Reply via email to