Renamed method to check if the driver supports nested transaction.

This commit is contained in:
Juan Basso 2012-04-26 20:19:03 -04:00
parent f150ebb9cc
commit 37537faac0
8 changed files with 11 additions and 11 deletions

View file

@ -681,7 +681,7 @@ class Mysql extends DboSource {
* *
* @return boolean * @return boolean
*/ */
public function supportNestedTransaction() { public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '4.1', '>='); return $this->nestedTransaction && version_compare($this->getVersion(), '4.1', '>=');
} }

View file

@ -900,7 +900,7 @@ class Postgres extends DboSource {
* *
* @return boolean * @return boolean
*/ */
public function supportNestedTransaction() { public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '8.0', '>='); return $this->nestedTransaction && version_compare($this->getVersion(), '8.0', '>=');
} }

View file

@ -564,7 +564,7 @@ class Sqlite extends DboSource {
* *
* @return boolean * @return boolean
*/ */
public function supportNestedTransaction() { public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '3.6.8', '>='); return $this->nestedTransaction && version_compare($this->getVersion(), '3.6.8', '>=');
} }

View file

@ -2031,7 +2031,7 @@ class DboSource extends DataSource {
* *
* @return boolean * @return boolean
*/ */
public function supportNestedTransaction() { public function nestedTransactionSupported() {
return false; return false;
} }
@ -2044,7 +2044,7 @@ class DboSource extends DataSource {
*/ */
public function begin() { public function begin() {
if ($this->_transactionStarted) { if ($this->_transactionStarted) {
if ($this->supportNestedTransaction()) { if ($this->nestedTransactionSupported()) {
return $this->_beginNested(); return $this->_beginNested();
} }
$this->_transactionNesting++; $this->_transactionNesting++;
@ -2092,7 +2092,7 @@ class DboSource extends DataSource {
return $this->_connection->commit(); return $this->_connection->commit();
} }
if ($this->supportNestedTransaction()) { if ($this->nestedTransactionSupported()) {
return $this->_commitNested(); return $this->_commitNested();
} }
@ -2134,7 +2134,7 @@ class DboSource extends DataSource {
return $this->_connection->rollBack(); return $this->_connection->rollBack();
} }
if ($this->supportNestedTransaction()) { if ($this->nestedTransactionSupported()) {
return $this->_rollbackNested(); return $this->_rollbackNested();
} }

View file

@ -3588,7 +3588,7 @@ class MysqlTest extends CakeTestCase {
public function testNestedTransaction() { public function testNestedTransaction() {
$nested = $this->Dbo->nestedTransaction; $nested = $this->Dbo->nestedTransaction;
$this->Dbo->nestedTransaction = true; $this->Dbo->nestedTransaction = true;
if ($this->Dbo->supportNestedTransaction() === false) { if ($this->Dbo->nestedTransactionSupported() === false) {
$this->Dbo->nestedTransaction = $nested; $this->Dbo->nestedTransaction = $nested;
$this->skipIf(true, 'The MySQL server do not support nested transaction'); $this->skipIf(true, 'The MySQL server do not support nested transaction');
} }

View file

@ -915,7 +915,7 @@ class PostgresTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testNestedTransaction() { public function testNestedTransaction() {
$this->skipIf($this->Dbo->supportNestedTransaction() === false, 'The Postgres server do not support nested transaction'); $this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Postgres server do not support nested transaction');
$this->loadFixtures('Article'); $this->loadFixtures('Article');
$model = new Article(); $model = new Article();

View file

@ -389,7 +389,7 @@ class SqliteTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testNestedTransaction() { public function testNestedTransaction() {
$this->skipIf($this->Dbo->supportNestedTransaction() === false, 'The Sqlite version do not support nested transaction'); $this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Sqlite version do not support nested transaction');
$this->loadFixtures('User'); $this->loadFixtures('User');
$model = new User(); $model = new User();

View file

@ -53,7 +53,7 @@ class DboTestSource extends DboSource {
$this->_connection = $conn; $this->_connection = $conn;
} }
public function supportNestedTransaction() { public function nestedTransactionSupported() {
return $this->nestedTransaction && $this->nestedSupport; return $this->nestedTransaction && $this->nestedSupport;
} }