[PEAR-BUG] Bug #16781 [Com]: transactions not working

[email protected] ("[email protected]")
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=16781&edit=1

 ID:               16781
 Comment by:       [email protected]
 Reported By:      fanwar at gmail dot com
 Summary:          transactions not working
 Status:           Open
 Type:             Bug
 Package:          MDB2_Driver_mysql
 Operating System: BSD
 Package Version:  1.4.1
 PHP Version:      5.2.3
 Roadmap Versions: 
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2011-03-13 12:44:54] alec

Works for me with current versions.

------------------------------------------------------------------------

[2009-11-11 23:21:57] fanwar

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
)

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=16781&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.