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

Bug #4672 Commit always returning true
Submitted: 2005-06-24 07:36 UTC
From: rofranco at c17 dot net Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: 4.3.11 OS: Linux
Roadmaps: (Not assigned)    

 [2005-06-24 07:36 UTC] rofranco at c17 dot net
Description: ------------ We are using the "DEFERRABLE" and "INITIALY DEFERRED" options in our PostgreSQL database, and found that sometimes there can be an error during COMMIT. Therefore, we've made 2 small changes to DataObject.php to be able to handle the return value of the commit function. I'm copying the patch file in case you consider it worth including in DataObject.php Reproduce code: --------------- --- DataObject.php 2005-06-24 09:20:03.139954064 +0200 +++ DataObject.php2 2005-06-24 09:25:12.923859752 +0200 @@ -2209,11 +2209,11 @@ return true; } if (strtoupper($string) == 'COMMIT') { - $DB->commit(); + $res = $DB->commit(); if ($_DB_driver == 'DB') { $DB->autoCommit(true); } - return true; + return $res; } if (strtoupper($string) == 'ROLLBACK') { Expected result: ---------------- Returning this value, we are able to determine if the transaction was successfull or not, and act accordingly.


 [2005-06-25 03:41 UTC] alan_k
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.