php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57206 Add ability to change auto_commit
Submitted: 2006-08-30 12:27 UTC Modified: 2013-10-15 11:54 UTC
Votes:6
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tiggscharley at charter dot net Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.1.4 OS: FreeBSD 6.1-Release
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tiggscharley at charter dot net
New email:
PHP Version: OS:

 

 [2006-08-30 12:27 UTC] 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-&gt;setAttribute(0, false)
#1 {main}
  thrown in /usr/local/www/test_autocommit.php on line 4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-01 10:39 UTC] mike@php.net
-Status: Open +Status: Feedback -Package: PDO_PGSQL +Package: *General Issues
 [2013-10-01 10:39 UTC] mike@php.net
What's wrong with BEGIN & COMMIT?
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 16:01:28 2024 UTC