Skip to content

Commit

Permalink
Renamed method to check if the driver supports nested transaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 27, 2012
1 parent f150ebb commit 37537fa
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Mysql.php
Expand Up @@ -681,7 +681,7 @@ public function getSchemaName() {
*
* @return boolean
*/
public function supportNestedTransaction() {
public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '4.1', '>=');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -900,7 +900,7 @@ public function getSchemaName() {
*
* @return boolean
*/
public function supportNestedTransaction() {
public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '8.0', '>=');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Sqlite.php
Expand Up @@ -564,7 +564,7 @@ public function getSchemaName() {
*
* @return boolean
*/
public function supportNestedTransaction() {
public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '3.6.8', '>=');
}

Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -2031,7 +2031,7 @@ public function truncate($table) {
*
* @return boolean
*/
public function supportNestedTransaction() {
public function nestedTransactionSupported() {
return false;
}

Expand All @@ -2044,7 +2044,7 @@ public function supportNestedTransaction() {
*/
public function begin() {
if ($this->_transactionStarted) {
if ($this->supportNestedTransaction()) {
if ($this->nestedTransactionSupported()) {
return $this->_beginNested();
}
$this->_transactionNesting++;
Expand Down Expand Up @@ -2092,7 +2092,7 @@ public function commit() {
return $this->_connection->commit();
}

if ($this->supportNestedTransaction()) {
if ($this->nestedTransactionSupported()) {
return $this->_commitNested();
}

Expand Down Expand Up @@ -2134,7 +2134,7 @@ public function rollback() {
return $this->_connection->rollBack();
}

if ($this->supportNestedTransaction()) {
if ($this->nestedTransactionSupported()) {
return $this->_rollbackNested();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -3588,7 +3588,7 @@ public function testTruncateStatements() {
public function testNestedTransaction() {
$nested = $this->Dbo->nestedTransaction;
$this->Dbo->nestedTransaction = true;
if ($this->Dbo->supportNestedTransaction() === false) {
if ($this->Dbo->nestedTransactionSupported() === false) {
$this->Dbo->nestedTransaction = $nested;
$this->skipIf(true, 'The MySQL server do not support nested transaction');
}
Expand Down
Expand Up @@ -915,7 +915,7 @@ public function testTruncateStatements() {
* @return void
*/
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');
$model = new Article();
Expand Down
Expand Up @@ -389,7 +389,7 @@ public function testUuidPrimaryKeyInsertion() {
* @return void
*/
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');
$model = new User();
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
Expand Up @@ -53,7 +53,7 @@ public function setConnection($conn) {
$this->_connection = $conn;
}

public function supportNestedTransaction() {
public function nestedTransactionSupported() {
return $this->nestedTransaction && $this->nestedSupport;
}

Expand Down

0 comments on commit 37537fa

Please sign in to comment.