Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #16781 transactions not working
Submitted: 2009-11-12 04:21 UTC
From: fanwar Assigned:
Status: Open Package: MDB2_Driver_mysql (version 1.4.1)
PHP Version: 5.2.3 OS: BSD
Roadmaps: (Not assigned)    
Subscription  


 [2009-11-12 04:21 UTC] fanwar (Faisal Anwar)
Description: ------------ I'm having a difficult time with MDB2_driver_mysql and getting it to recognize transactions. I have mysql installed with InnoDB tables and when I do a $db->supports['transactions'], it keeps returning false. I checked the supported array and the values are just not set. I'm using version 1.4.1 of the driver. Anyone know what the problem may be? Here is the code I am running: Before Test script: --------------- $conn_string = "{$dbtype}://{$dbuser}:{$dbpass}@{$dbhost}/{$dbname}"; $options = array(); $options['use_transactions'] = true; $options['default_table_type'] = 'InnoDB'; $dbconn =& MDB2::singleton($conn_string, $options); if (PEAR::isError($dbconn)) { getLogger()->log("Error creating db connection: " . $dbconn->getMessage(), CritterSettings::LOG_LEVEL_CRIT); die($dbconn->getMessage()); } //BEGIN TRANSACTION HERE if ($this->db->supports('transactions')) { $this->db->beginTransaction(); } else { throw new Exception("Database is not correctly configured - transactions unsupported"); } //the exception keeps getting thrown Expected result: ---------------- I expect to get true since I am using InnoDB tables and transactions should be supported. Actual result: -------------- I get false and when I print out the supported array, it shows: Nov 11 17:08:01 [info] Array ( [sequences] => emulated [indexes] => 1 [affected_rows] => 1 [summary_functions] => 1 [order_by_text] => 1 [transactions] => [savepoints] => [current_id] => emulated [limit_queries] => 1 [LOBs] => 1 [replace] => 1 [sub_selects] => emulated [auto_increment] => 1 [primary_key] => 1 [result_introspection] => 1 [prepared_statements] => emulated [identifier_quoting] => 1 [pattern_escaping] => 1 [new_link] => 1 )

Comments

 [2011-03-13 16:44 UTC] alec (Aleksander Machniak)
Works for me with current versions.
 [2014-08-29 19:48 UTC] nik600 (Mosca Nicola)
maybe you are using multiple MDB2 connections in the same script? Take a look at this patch/bug it seems to resolve my problem http://pear.php.net/bugs/bug.php?id=20379