cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php
| From: | Lukas Smith | Date: | Sun, 16 Oct 2005 14:34:03 +0000 |
| Subject: | cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35596@lists.php.net to get a copy of this message | ||
lsmith Sun Oct 16 10:34:03 2005 EDT
Modified files:
/pear/MDB2 MDB2.php
/pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php
mysqli.php oci8.php pgsql.php querysim.php
sqlite.php
Log:
- rollback open transactions in disconnect() with persistent connections
http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.130&r2=1.131&ty=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.130 pear/MDB2/MDB2.php:1.131 --- pear/MDB2/MDB2.php:1.130 Sat Oct 15 04:39:22 2005 +++ pear/MDB2/MDB2.php Sun Oct 16 10:33:57 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.130 2005/10/15 08:39:22 lsmith Exp $ +// $Id: MDB2.php,v 1.131 2005/10/16 14:33:57 lsmith Exp $ // /** @@ -1124,15 +1124,7 @@ */ function __destruct() { - if ($this->connection) { - if ($this->opened_persistent) { - if ($this->in_transaction) { - $this->rollback(); - } - } else { - $this->disconnect(); - } - } + $this->disconnect(false); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.74&r2=1.75&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.74 pear/MDB2/MDB2/Driver/fbsql.php:1.75 --- pear/MDB2/MDB2/Driver/fbsql.php:1.74 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/fbsql.php Sun Oct 16 10:34:00 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.74 2005/10/15 08:45:22 lsmith Exp $ +// $Id: fbsql.php,v 1.75 2005/10/16 14:34:00 lsmith Exp $ // /** @@ -284,6 +284,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @fbsql_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.111&r2=1.112&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.111 pear/MDB2/MDB2/Driver/ibase.php:1.112 --- pear/MDB2/MDB2/Driver/ibase.php:1.111 Sun Oct 16 09:15:11 2005 +++ pear/MDB2/MDB2/Driver/ibase.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.111 2005/10/16 13:15:11 quipo Exp $ +// $Id: ibase.php,v 1.112 2005/10/16 14:34:01 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -426,6 +426,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @ibase_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.85&r2=1.86&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.85 pear/MDB2/MDB2/Driver/mssql.php:1.86 --- pear/MDB2/MDB2/Driver/mssql.php:1.85 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/mssql.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.85 2005/10/15 08:45:22 lsmith Exp $ +// $Id: mssql.php,v 1.86 2005/10/16 14:34:01 lsmith Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -309,6 +309,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @mssql_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.77&r2=1.78&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.77 pear/MDB2/MDB2/Driver/mysql.php:1.78 --- pear/MDB2/MDB2/Driver/mysql.php:1.77 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/mysql.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.77 2005/10/15 08:45:22 lsmith Exp $ +// $Id: mysql.php,v 1.78 2005/10/16 14:34:01 lsmith Exp $ // /** @@ -407,6 +407,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @mysql_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.42&r2=1.43&ty=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.42 pear/MDB2/MDB2/Driver/mysqli.php:1.43 --- pear/MDB2/MDB2/Driver/mysqli.php:1.42 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/mysqli.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.42 2005/10/15 08:45:22 lsmith Exp $ +// $Id: mysqli.php,v 1.43 2005/10/16 14:34:01 lsmith Exp $ // /** @@ -409,6 +409,8 @@ if (is_object($this->connection)) { if ($force) { @mysqli_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.95&r2=1.96&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.95 pear/MDB2/MDB2/Driver/oci8.php:1.96 --- pear/MDB2/MDB2/Driver/oci8.php:1.95 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.95 2005/10/15 08:45:22 lsmith Exp $ +// $Id: oci8.php,v 1.96 2005/10/16 14:34:01 lsmith Exp $ /** * MDB2 OCI8 driver @@ -359,6 +359,8 @@ } else { @OCILogOff($this->connection); } + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.76&r2=1.77&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.76 pear/MDB2/MDB2/Driver/pgsql.php:1.77 --- pear/MDB2/MDB2/Driver/pgsql.php:1.76 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/pgsql.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.76 2005/10/15 08:45:22 lsmith Exp $ +// $Id: pgsql.php,v 1.77 2005/10/16 14:34:01 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -380,6 +380,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @pg_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.44&r2=1.45&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.44 pear/MDB2/MDB2/Driver/querysim.php:1.45 --- pear/MDB2/MDB2/Driver/querysim.php:1.44 Sat Oct 15 04:39:29 2005 +++ pear/MDB2/MDB2/Driver/querysim.php Sun Oct 16 10:34:02 2005 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.44 2005/10/15 08:39:29 lsmith Exp $ +// $Id: querysim.php,v 1.45 2005/10/16 14:34:02 lsmith Exp $ // /* @@ -316,10 +316,8 @@ function disconnect() { if (is_resource($this->connection)) { - if (($this->opened_persistent) && (is_resource($this->connection))) { - if (!@fclose($this->connection)) { - return $this->raiseError(); - } + if (($this->opened_persistent))) { + @fclose($this->connection) } $this->connection = 0; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.78&r2=1.79&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.78 pear/MDB2/MDB2/Driver/sqlite.php:1.79 --- pear/MDB2/MDB2/Driver/sqlite.php:1.78 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/sqlite.php Sun Oct 16 10:34:02 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.78 2005/10/15 08:45:22 lsmith Exp $ +// $Id: sqlite.php,v 1.79 2005/10/16 14:34:02 lsmith Exp $ // /** @@ -337,6 +337,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @sqlite_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false;
http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.130&r2=1.131&ty=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.130 pear/MDB2/MDB2.php:1.131 --- pear/MDB2/MDB2.php:1.130 Sat Oct 15 04:39:22 2005 +++ pear/MDB2/MDB2.php Sun Oct 16 10:33:57 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.130 2005/10/15 08:39:22 lsmith Exp $ +// $Id: MDB2.php,v 1.131 2005/10/16 14:33:57 lsmith Exp $ // /** @@ -1124,15 +1124,7 @@ */ function __destruct() { - if ($this->connection) { - if ($this->opened_persistent) { - if ($this->in_transaction) { - $this->rollback(); - } - } else { - $this->disconnect(); - } - } + $this->disconnect(false); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.74&r2=1.75&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.74 pear/MDB2/MDB2/Driver/fbsql.php:1.75 --- pear/MDB2/MDB2/Driver/fbsql.php:1.74 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/fbsql.php Sun Oct 16 10:34:00 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.74 2005/10/15 08:45:22 lsmith Exp $ +// $Id: fbsql.php,v 1.75 2005/10/16 14:34:00 lsmith Exp $ // /** @@ -284,6 +284,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @fbsql_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.111&r2=1.112&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.111 pear/MDB2/MDB2/Driver/ibase.php:1.112 --- pear/MDB2/MDB2/Driver/ibase.php:1.111 Sun Oct 16 09:15:11 2005 +++ pear/MDB2/MDB2/Driver/ibase.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.111 2005/10/16 13:15:11 quipo Exp $ +// $Id: ibase.php,v 1.112 2005/10/16 14:34:01 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -426,6 +426,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @ibase_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.85&r2=1.86&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.85 pear/MDB2/MDB2/Driver/mssql.php:1.86 --- pear/MDB2/MDB2/Driver/mssql.php:1.85 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/mssql.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.85 2005/10/15 08:45:22 lsmith Exp $ +// $Id: mssql.php,v 1.86 2005/10/16 14:34:01 lsmith Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -309,6 +309,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @mssql_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.77&r2=1.78&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.77 pear/MDB2/MDB2/Driver/mysql.php:1.78 --- pear/MDB2/MDB2/Driver/mysql.php:1.77 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/mysql.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.77 2005/10/15 08:45:22 lsmith Exp $ +// $Id: mysql.php,v 1.78 2005/10/16 14:34:01 lsmith Exp $ // /** @@ -407,6 +407,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @mysql_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.42&r2=1.43&ty=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.42 pear/MDB2/MDB2/Driver/mysqli.php:1.43 --- pear/MDB2/MDB2/Driver/mysqli.php:1.42 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/mysqli.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.42 2005/10/15 08:45:22 lsmith Exp $ +// $Id: mysqli.php,v 1.43 2005/10/16 14:34:01 lsmith Exp $ // /** @@ -409,6 +409,8 @@ if (is_object($this->connection)) { if ($force) { @mysqli_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.95&r2=1.96&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.95 pear/MDB2/MDB2/Driver/oci8.php:1.96 --- pear/MDB2/MDB2/Driver/oci8.php:1.95 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.95 2005/10/15 08:45:22 lsmith Exp $ +// $Id: oci8.php,v 1.96 2005/10/16 14:34:01 lsmith Exp $ /** * MDB2 OCI8 driver @@ -359,6 +359,8 @@ } else { @OCILogOff($this->connection); } + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.76&r2=1.77&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.76 pear/MDB2/MDB2/Driver/pgsql.php:1.77 --- pear/MDB2/MDB2/Driver/pgsql.php:1.76 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/pgsql.php Sun Oct 16 10:34:01 2005 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.76 2005/10/15 08:45:22 lsmith Exp $ +// $Id: pgsql.php,v 1.77 2005/10/16 14:34:01 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -380,6 +380,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @pg_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.44&r2=1.45&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.44 pear/MDB2/MDB2/Driver/querysim.php:1.45 --- pear/MDB2/MDB2/Driver/querysim.php:1.44 Sat Oct 15 04:39:29 2005 +++ pear/MDB2/MDB2/Driver/querysim.php Sun Oct 16 10:34:02 2005 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.44 2005/10/15 08:39:29 lsmith Exp $ +// $Id: querysim.php,v 1.45 2005/10/16 14:34:02 lsmith Exp $ // /* @@ -316,10 +316,8 @@ function disconnect() { if (is_resource($this->connection)) { - if (($this->opened_persistent) && (is_resource($this->connection))) { - if (!@fclose($this->connection)) { - return $this->raiseError(); - } + if (($this->opened_persistent))) { + @fclose($this->connection) } $this->connection = 0; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.78&r2=1.79&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.78 pear/MDB2/MDB2/Driver/sqlite.php:1.79 --- pear/MDB2/MDB2/Driver/sqlite.php:1.78 Sat Oct 15 04:45:22 2005 +++ pear/MDB2/MDB2/Driver/sqlite.php Sun Oct 16 10:34:02 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.78 2005/10/15 08:45:22 lsmith Exp $ +// $Id: sqlite.php,v 1.79 2005/10/16 14:34:02 lsmith Exp $ // /** @@ -337,6 +337,8 @@ if (is_resource($this->connection)) { if (!$this->opened_persistent || $force) { @sqlite_close($this->connection); + } elseif($this->in_transaction) { + $this->rollback(); } $this->connection = 0; $this->in_transaction = false;