diff --git a/inc/AwlDatabase.php b/inc/AwlDatabase.php index 9b575401..7c1e6348 100644 --- a/inc/AwlDatabase.php +++ b/inc/AwlDatabase.php @@ -95,6 +95,7 @@ class AwlDatabase extends AwlDBDialect { else { trigger_error("Cannot begin a transaction while a transaction is already active.", E_USER_ERROR); } + return true; } @@ -106,6 +107,7 @@ class AwlDatabase extends AwlDBDialect { $this->db->commit(); $this->txnstate = 0; } + return true; } @@ -120,6 +122,7 @@ class AwlDatabase extends AwlDBDialect { else { trigger_error("Cannot rollback unless a transaction is already active.", E_USER_ERROR); } + return true; } diff --git a/inc/AwlQuery.php b/inc/AwlQuery.php index 4b6e62f3..ca07547a 100644 --- a/inc/AwlQuery.php +++ b/inc/AwlQuery.php @@ -358,6 +358,41 @@ class AwlQuery } + /** + * Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec() + */ + public function Begin() { + global $_awl_dbconn; + if ( !isset($this->connection) ) { + if ( !isset($_awl_dbconn) ) _awl_connect_configured_database(); + $this->connection = $_awl_dbconn; + } + return $this->connection->Begin(); + } + + + /** + * Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec() + */ + public function Commit() { + if ( !isset($this->connection) ) { + trigger_error("Cannot commit a transaction without an active statement.", E_USER_ERROR); + } + return $this->connection->Commit(); + } + + + /** + * Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec() + */ + public function Rollback() { + if ( !isset($this->connection) ) { + trigger_error("Cannot rollback a transaction without an active statement.", E_USER_ERROR); + } + return $this->connection->Rollback(); + } + + /** * Execute the query, logging any debugging. *