1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

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
This commit is contained in:
Paul S. Owen
2002-03-05 02:19:38 +00:00
parent be2532588c
commit 28b38f0547
5 changed files with 99 additions and 29 deletions

View File

@@ -100,13 +100,13 @@ class sql_db
unset($this->result);
unset($this->row);
if( $query != "" )
if ( $query != "" )
{
$this->num_queries++;
if($transaction == BEGIN_TRANSACTION)
if ( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
{
if( !mssql_query("BEGIN TRANSACTION", $this->db_connect_id) )
if ( !mssql_query("BEGIN TRANSACTION", $this->db_connect_id) )
{
return false;
}
@@ -196,12 +196,32 @@ class sql_db
if( $transaction == END_TRANSACTION && $this->in_transaction )
{
mssql_query("COMMIT", $this->db_connect_id);
$this->in_transaction = FALSE;
if( !@mssql_query("COMMIT", $this->db_connect_id) )
{
@mssql_query("ROLLBACK", $this->db_connect_id);
return false;
}
}
return $this->result;
}
else
{
if( $transaction == END_TRANSACTION && $this->in_transaction )
{
$this->in_transaction = FALSE;
if( !@mssql_query("COMMIT", $this->db_connect_id) )
{
@mssql_query("ROLLBACK", $this->db_connect_id);
return false;
}
}
return true;
}
}
//