diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-05 02:19:38 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-05 02:19:38 +0000 |
| commit | 28b38f054786014f436eefa019308eb8658cb711 (patch) | |
| tree | 4be0b2cbdc589b216f85aacc7950a4123aecf101 /phpBB/db/msaccess.php | |
| parent | be2532588c3a0472d915bc378207883c350f1a0c (diff) | |
| download | forums-28b38f054786014f436eefa019308eb8658cb711.tar forums-28b38f054786014f436eefa019308eb8658cb711.tar.gz forums-28b38f054786014f436eefa019308eb8658cb711.tar.bz2 forums-28b38f054786014f436eefa019308eb8658cb711.tar.xz forums-28b38f054786014f436eefa019308eb8658cb711.zip | |
Fixed various transaction related issues and changed mssql-odbc name to ... mssql-odbc, hopefully this hasn't been (and won't be) responsible for any problems ...
git-svn-id: file:///svn/phpbb/trunk@2269 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/db/msaccess.php')
| -rw-r--r-- | phpBB/db/msaccess.php | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/phpBB/db/msaccess.php b/phpBB/db/msaccess.php index a2ae1a32a5..fe45540be2 100644 --- a/phpBB/db/msaccess.php +++ b/phpBB/db/msaccess.php @@ -94,7 +94,7 @@ class sql_db { $this->num_queries++; - if( $transaction == BEGIN_TRANSACTION ) + if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction ) { if( !odbc_autocommit($this->db_connect_id, false) ) { @@ -195,16 +195,35 @@ class sql_db if( $transaction == END_TRANSACTION && $this->in_transaction ) { - odbc_commit($this->db_connect_id); - odbc_autocommit($this->db_connect_id, true); $this->in_transaction = FALSE; + + if ( !@odbc_commit($this->db_connect_id) ) + { + odbc_rollback($this->db_connect_id); + odbc_autocommit($this->db_connect_id, true); + return false; + } + odbc_autocommit($this->db_connect_id, true); } return $this->result; } else { - return false; + if( $transaction == END_TRANSACTION && $this->in_transaction ) + { + $this->in_transaction = FALSE; + + if ( !@odbc_commit($this->db_connect_id) ) + { + odbc_rollback($this->db_connect_id); + odbc_autocommit($this->db_connect_id, true); + return false; + } + odbc_autocommit($this->db_connect_id, true); + } + + return true; } } |
