|
大家好,如题...........请帮帮忙.................
代码-->
class User extends Doctrine_Record {
public function setTableDefinition(){
$this->hasColumn('username','string',255);
$this->hasColumn('password','string',255);
$this->hasColumn('first_name','string',255);
$this->hasColumn('last_name','string',255);
}
}
---------------------------------------------------
代码-->
class Hello extends Controller {
function index(){
//储存第一个对象
$user1=new User();
$user1->username='jack';
$user1->password='123456';
$user1->first_name='chen';
$user1->last_name='fuck';
$user1->save();
}
}
--------------------------------------------
异常->
Fatal error: Uncaught exception 'Doctrine_Transaction_Exception' with message 'Rollback failed.
There is no active transaction.' in
C:\AppServ\www\CodeIgniter\system\application\plugins\doctrine\lib\Doctrine\Transaction.php:319
Stack trace: #0
C:\AppServ\www\CodeIgniter\system\application\plugins\doctrine\lib\Doctrine\Connection.php(1426):
Doctrine_Transaction->rollback(NULL) #1
C:\AppServ\www\CodeIgniter\system\application\plugins\doctrine\lib\Doctrine\Connection\UnitOfWork.ph
p(136): Doctrine_Connection->rollback() #2
C:\AppServ\www\CodeIgniter\system\application\plugins\doctrine\lib\Doctrine\Record.php(1599):
Doctrine_Connection_UnitOfWork->saveGraph(Object(User)) #3
C:\AppServ\www\CodeIgniter\system\application\controllers\hello.php(18): Doctrine_Record->save() #4
[internal function]: Hello->index() #5
C:\AppServ\www\CodeIgniter\system\codeigniter\CodeIgniter.php(236): call_user_func_array(Array,
Array) #6 C:\AppServ\www\CodeIgniter\index.php(115): require_once('C:\AppServ\www\...') #7 {main}
thrown in
C:\AppServ\www\CodeIgniter\system\application\plugins\doctrine\lib\Doctrine\Transaction.php on line
319 |
|