当前位置: 首页>>代码示例>>PHP>>正文


PHP DboSource::rollback方法代码示例

本文整理汇总了PHP中DboSource::rollback方法的典型用法代码示例。如果您正苦于以下问题:PHP DboSource::rollback方法的具体用法?PHP DboSource::rollback怎么用?PHP DboSource::rollback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DboSource的用法示例。


在下文中一共展示了DboSource::rollback方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testNestedTransaction

 /**
  * Test nested transaction
  *
  * @return void
  */
 public function testNestedTransaction()
 {
     $nested = $this->Dbo->useNestedTransactions;
     $this->Dbo->useNestedTransactions = true;
     if ($this->Dbo->nestedTransactionSupported() === false) {
         $this->Dbo->useNestedTransactions = $nested;
         $this->skipIf(true, 'The MySQL server do not support nested transaction');
     }
     $this->loadFixtures('Inno');
     $model = ClassRegistry::init('Inno');
     $model->hasOne = $model->hasMany = $model->belongsTo = $model->hasAndBelongsToMany = array();
     $model->cacheQueries = false;
     $this->Dbo->cacheMethods = false;
     $this->assertTrue($this->Dbo->begin());
     $this->assertNotEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->begin());
     $this->assertTrue($model->delete(1));
     $this->assertEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->rollback());
     $this->assertNotEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->begin());
     $this->assertTrue($model->delete(1));
     $this->assertEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->commit());
     $this->assertEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->rollback());
     $this->assertNotEmpty($model->read(null, 1));
     $this->Dbo->useNestedTransactions = $nested;
 }
开发者ID:laiello,项目名称:double-l-bookmanagement,代码行数:34,代码来源:MysqlTest.php

示例2: run

 /**
  * Run migration
  *
  * @param string $direction, up or down direction of migration process
  * @return boolean Status of the process
  * @throws MigrationException
  */
 public function run($direction)
 {
     if (!in_array($direction, array('up', 'down'))) {
         throw new MigrationException($this, sprintf(__d('migrations', 'Migration direction (%s) is not one of valid directions.'), $direction), E_USER_NOTICE);
     }
     $this->direction = $direction;
     $null = null;
     $this->db = ConnectionManager::getDataSource($this->connection);
     $this->db->cacheSources = false;
     $this->db->begin($null);
     $this->Schema = new CakeSchema(array('connection' => $this->connection));
     try {
         $this->_invokeCallbacks('beforeMigration', $direction);
         $result = $this->_run();
         $this->_clearCache();
         $this->_invokeCallbacks('afterMigration', $direction);
         if (!$result) {
             return false;
         }
     } catch (Exception $e) {
         $this->db->rollback($null);
         throw $e;
     }
     return $this->db->commit($null);
 }
开发者ID:asadaqain,项目名称:Guide-on-the-Side,代码行数:32,代码来源:CakeMigration.php

示例3: testNestedTransaction

 /**
  * Test nested transaction
  *
  * @return void
  */
 public function testNestedTransaction()
 {
     $this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Sqlite version do not support nested transaction');
     $this->loadFixtures('User');
     $model = new User();
     $model->hasOne = $model->hasMany = $model->belongsTo = $model->hasAndBelongsToMany = array();
     $model->cacheQueries = false;
     $this->Dbo->cacheMethods = false;
     $this->assertTrue($this->Dbo->begin());
     $this->assertNotEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->begin());
     $this->assertTrue($model->delete(1));
     $this->assertEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->rollback());
     $this->assertNotEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->begin());
     $this->assertTrue($model->delete(1));
     $this->assertEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->commit());
     $this->assertEmpty($model->read(null, 1));
     $this->assertTrue($this->Dbo->rollback());
     $this->assertNotEmpty($model->read(null, 1));
 }
开发者ID:saihe,项目名称:reservation,代码行数:28,代码来源:SqliteTest.php

示例4: rollback

 /**
  * Rollback a transaction
  *
  * @param unknown_type $model
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 function rollback(&$model)
 {
     if (parent::rollback($model)) {
         return $this->execute('ROLLBACK TRAN');
     }
     return false;
 }
开发者ID:christianallred,项目名称:fluent_univ,代码行数:15,代码来源:dbo_sybase.php

示例5: rollback

 /**
  * Rollback a transaction
  *
  * @param unknown_type $model
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 function rollback(&$model)
 {
     if (parent::rollback($model)) {
         $this->_transactionStarted = false;
         db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON);
         return db2_rollback($this->connection);
     }
     return false;
 }
开发者ID:christianallred,项目名称:fluent_univ,代码行数:17,代码来源:dbo_db2.php

示例6: rollback

 /**
  * Rollback a transaction
  *
  * @param unknown_type $model
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 function rollback(&$model)
 {
     if (parent::rollback($model)) {
         return $this->_adodb->RollbackTrans();
     }
     return false;
 }
开发者ID:jerzzz777,项目名称:cake-cart,代码行数:15,代码来源:dbo_adodb.php

示例7: rollback

 /**
  * Rollback a transaction
  *
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 public function rollback()
 {
     if (parent::rollback()) {
         return $this->_adodb->RollbackTrans();
     }
     return false;
 }
开发者ID:cahs,项目名称:datasources,代码行数:14,代码来源:Adodb.php

示例8: rollback

 /**
  * Rollback a transaction
  *
  * @param unknown_type $model
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 function rollback(&$model)
 {
     if (parent::rollback($model)) {
         return $this->pdo_statement->rollBack();
     }
     return false;
 }
开发者ID:JCVI-Cloud,项目名称:METAREP,代码行数:15,代码来源:dbo_sqlite3.php

示例9: rollback

 /**
  * Rollback a transaction
  *
  * @param unknown_type $model
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 function rollback(&$model)
 {
     if (parent::rollback($model)) {
         $this->_transactionStarted = false;
         return odbc_rollback($this->connection);
     }
     return false;
 }
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:16,代码来源:dbo_odbc.php

示例10: rollback

 /**
  * Rollback a transaction
  *
  * @param unknown_type $model
  * @return boolean True on success, false on fail
  * (i.e. if the database/model does not support transactions,
  * or a transaction has not started).
  */
 function rollback(&$model)
 {
     if (parent::rollback($model)) {
         return oci_rollback($this->connection);
     }
     return false;
 }
开发者ID:hikmanet,项目名称:HnsAutomobiles,代码行数:15,代码来源:dbo_oci.php

示例11: testNestedTransaction

 /**
  * Test nested transaction
  *
  * @return void
  */
 public function testNestedTransaction()
 {
     $this->Dbo->useNestedTransactions = TRUE;
     $this->skipIf($this->Dbo->nestedTransactionSupported() === FALSE, 'The Postgres server do not support nested transaction');
     $this->loadFixtures('Article');
     $model = new Article();
     $model->hasOne = $model->hasMany = $model->belongsTo = $model->hasAndBelongsToMany = array();
     $model->cacheQueries = FALSE;
     $this->Dbo->cacheMethods = FALSE;
     $this->assertTrue($this->Dbo->begin());
     $this->assertNotEmpty($model->read(NULL, 1));
     $this->assertTrue($this->Dbo->begin());
     $this->assertTrue($model->delete(1));
     $this->assertEmpty($model->read(NULL, 1));
     $this->assertTrue($this->Dbo->rollback());
     $this->assertNotEmpty($model->read(NULL, 1));
     $this->assertTrue($this->Dbo->begin());
     $this->assertTrue($model->delete(1));
     $this->assertEmpty($model->read(NULL, 1));
     $this->assertTrue($this->Dbo->commit());
     $this->assertEmpty($model->read(NULL, 1));
     $this->assertTrue($this->Dbo->rollback());
     $this->assertNotEmpty($model->read(NULL, 1));
 }
开发者ID:mrbadao,项目名称:api-official,代码行数:29,代码来源:PostgresTest.php


注:本文中的DboSource::rollback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。