Jonathan García
Jonathan García

Reputation: 839

transaction in cakephp 1.3

I have in my controller:

$dataSource = $this->getDataSource(); // line 141
$dataSource->begin($this);
if(...){
   $dataSource->commit($this);
}else{
   $dataSource->rollback($this);
}

but not works, I get the following error:

Fatal error: Call to undefined method AppusuariosController::getDataSource() in C:...\app\controllers\appusuarios_controller.php on line 141

I have to import getDataSource() ?

Upvotes: 3

Views: 880

Answers (1)

Jonathan García
Jonathan García

Reputation: 839

I have found a solution, I hope it helps someone in the future http://www.amitrawat.com/2011/08/30/transaction-cakephp/

Upvotes: 2

Related Questions