Req #57206 [Fbk->NoF]: Add ability to change auto_commit
| From: | php-bugs at lists dot php dot net | Date: | Tue, 15 Oct 2013 11:54:28 +0000 |
| Subject: | Req #57206 [Fbk->NoF]: Add ability to change auto_commit | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182192@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=57206&edit=1
ID: 57206
Updated by: php-bugs@lists.php.net
Reported by: tiggscharley at charter dot net
Summary: Add ability to change auto_commit
-Status: Feedback
+Status: No Feedback
Type: Feature/Change Request
Package: *General Issues
Operating System: FreeBSD 6.1-Release
PHP Version: 5.1.4
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2013-10-01 10:39:07] mike@php.net
What's wrong with BEGIN & COMMIT?
------------------------------------------------------------------------
[2006-08-30 12:27:13] tiggscharley at charter dot net
Description:
------------
Would it be possible to have the ability to change the value of PDO::ATTR_AUTOCOMMIT within the
PDO_PGSQL driver at will? Specifically, if a connection is opened where PDO::ATTR_AUTOCOMMIT is
true but there are certain processes that span classes within the currently executing page that use
the same connection, it would be helpful to be able to selectively turn off autocommit and turn it
back on once the transactions are complete. Attempting to set autocommit to off using
$dbh->setAttribute ( PDO::ATTR_AUTOCOMMIT, false ) after the connection has been made results in
an exception.
Reproduce code:
---------------
<?php
$dbh = new PDO('pgsql:host=localhost;dbname=postgres', 'postgres',
'');
$dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, false);
?>
Expected result:
----------------
PDO::ATTR_AUTOCOMMIT to be set to false.
Actual result:
--------------
Fatal error: Uncaught exception 'PDOException' with message 'The auto-commit mode
cannot be changed for this driver' in /usr/local/www/test_autocommit.php:4
Stack trace:
#0 /usr/local/www/test_autocommit.php(4): PDO->setAttribute(0, false)
#1 {main}
thrown in /usr/local/www/test_autocommit.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=57206&edit=1