diff options
Diffstat (limited to 'system/drivers/DB_mssql.php')
-rw-r--r-- | system/drivers/DB_mssql.php | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/system/drivers/DB_mssql.php b/system/drivers/DB_mssql.php index c84247641..3fbfa6a3f 100644 --- a/system/drivers/DB_mssql.php +++ b/system/drivers/DB_mssql.php @@ -76,7 +76,7 @@ class CI_DB_mssql extends CI_DB { * @param string an SQL query * @return resource */ - function execute($sql) + function _execute($sql) { $sql = $this->_prep_query($sql); return @mssql_query($sql, $this->conn_id); @@ -97,6 +97,81 @@ class CI_DB_mssql extends CI_DB { { return $sql; } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('BEGIN TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK TRAN'); + return TRUE; + } // -------------------------------------------------------------------- |