From:             brn at macrovita dot com dot br
Operating system: Mixed
PHP version:      Irrelevant
Package:          PDO related
Bug Type:         Bug
Bug description:Commit failure for repeated transactions on repeated PDO 
persistent connections

Description:
------------
Repeated transaction on repeated persistent PDO connection fails on commit
with 
'There is no active transaction'.

Reproduced on:
- Fedora 14 32bit PHP 5.3.6 
- Gentoo 64bit PHP 5.3.14

We'll work around the bug in application code, but we thought developers
might 
like to know about this.

// BTM5282

Test script:
---------------
# Should work, but does not:
cat <<'EOD' | php -d display_errors=1 && echo OK
<?php
$db = new PDO('sqlite::memory:', '', '', array(PDO::ATTR_PERSISTENT =>
true));
$db->beginTransaction();
$st = $db->query('select 1');
echo $st->fetchColumn()."\n";
$db->commit();
//$st = null;
$db = new PDO('sqlite::memory:', '', '', array(PDO::ATTR_PERSISTENT =>
true));
$db->beginTransaction();
$st = $db->query('select 2');
echo $st->fetchColumn()."\n";
$db->commit();
EOD
# INTERESTING? -> Works OK with uncommented $st = null;
# Works OK with PDO::ATTR_PERSISTENT => false .

Expected result:
----------------
1
2
OK

Actual result:
--------------
Fatal error: Uncaught exception 'PDOException' 
with message 'There is no active transaction' in -:11 ...

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63343&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63343&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63343&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63343&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63343&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63343&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63343&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63343&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63343&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63343&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63343&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63343&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63343&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63343&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63343&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63343&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63343&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63343&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63343&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63343&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63343&r=mysqlcfg

Reply via email to