diff --git a/dibi/drivers/mssql.php b/dibi/drivers/mssql.php index b113027d..0c14ffed 100644 --- a/dibi/drivers/mssql.php +++ b/dibi/drivers/mssql.php @@ -170,17 +170,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - throw new NotSupportedException('MSSQL driver does not support transaction testing.'); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/drivers/mssql2005.php b/dibi/drivers/mssql2005.php index d540d6b5..1ae5cd1d 100644 --- a/dibi/drivers/mssql2005.php +++ b/dibi/drivers/mssql2005.php @@ -172,17 +172,6 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - throw new NotSupportedException('MSSQL 2005 driver does not support transaction testing.'); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/drivers/mysql.php b/dibi/drivers/mysql.php index 20a8ace3..6617204a 100644 --- a/dibi/drivers/mysql.php +++ b/dibi/drivers/mysql.php @@ -246,17 +246,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - return (bool) mysql_result(mysql_query('SELECT @@autocommit', $this->connection), 0); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/drivers/mysqli.php b/dibi/drivers/mysqli.php index 61eb23e1..4198b6ad 100644 --- a/dibi/drivers/mysqli.php +++ b/dibi/drivers/mysqli.php @@ -230,18 +230,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - $row = mysqli_fetch_row(mysqli_query($this->connection, 'SELECT @@autocommit')); - return (bool) $row[0]; - } - - - /** * Returns the connection resource. * @return mysqli diff --git a/dibi/drivers/odbc.php b/dibi/drivers/odbc.php index 9dedb00b..8e49985a 100644 --- a/dibi/drivers/odbc.php +++ b/dibi/drivers/odbc.php @@ -184,7 +184,7 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver */ public function inTransaction() { - return (bool) odbc_autocommit($this->connection); + return !odbc_autocommit($this->connection); } diff --git a/dibi/drivers/oracle.php b/dibi/drivers/oracle.php index 64129ab8..ff839007 100644 --- a/dibi/drivers/oracle.php +++ b/dibi/drivers/oracle.php @@ -186,17 +186,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - throw new NotSupportedException('Oracle driver does not support transaction testing.'); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/drivers/pdo.php b/dibi/drivers/pdo.php index 6bc3e3a0..5e8d91d5 100644 --- a/dibi/drivers/pdo.php +++ b/dibi/drivers/pdo.php @@ -197,17 +197,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - return (bool) $this->connection->getAttribute(PDO::ATTR_AUTOCOMMIT); - } - - - /** * Returns the connection resource. * @return PDO diff --git a/dibi/drivers/postgre.php b/dibi/drivers/postgre.php index 656f11d7..f94d3d78 100644 --- a/dibi/drivers/postgre.php +++ b/dibi/drivers/postgre.php @@ -208,17 +208,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - throw new NotSupportedException('PostgreSQL driver does not support transaction testing.'); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/drivers/sqlite.php b/dibi/drivers/sqlite.php index 6cf08cc1..75524846 100644 --- a/dibi/drivers/sqlite.php +++ b/dibi/drivers/sqlite.php @@ -193,17 +193,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - throw new NotSupportedException('SQLite driver does not support transaction testing.'); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/drivers/sqlite3.php b/dibi/drivers/sqlite3.php index 0dc309f0..6f309dbb 100644 --- a/dibi/drivers/sqlite3.php +++ b/dibi/drivers/sqlite3.php @@ -183,17 +183,6 @@ class DibiSqlite3Driver extends DibiObject implements IDibiDriver - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - throw new NotSupportedException('SQLite3 driver does not support transaction testing.'); - } - - - /** * Returns the connection resource. * @return mixed diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 78555626..da81382f 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -446,18 +446,6 @@ class DibiConnection extends DibiObject - /** - * Is in transaction? - * @return bool - */ - public function inTransaction() - { - $this->connect(); - return $this->driver->inTransaction(); - } - - - /** * Encodes data for use in a SQL statement. * @param string unescaped string diff --git a/dibi/libs/interfaces.php b/dibi/libs/interfaces.php index 0b74ccef..734cb7c5 100644 --- a/dibi/libs/interfaces.php +++ b/dibi/libs/interfaces.php @@ -145,12 +145,6 @@ interface IDibiDriver */ function rollback($savepoint = NULL); - /** - * Is in transaction? - * @return bool - */ - function inTransaction(); - /** * Returns the connection resource. * @return mixed