|
CI 中 DB_driver.php 的这段代码的目的 应该是为了防止嵌套事务吧:
// When transactions are nested we only begin/commit/rollback the outermost ones
if ($this->_trans_depth > 0)
{
$this->_trans_depth += 1;
return;
}
$this->trans_begin($test_mode);
但一开始 _trans_depth =0 这段if永远不能被执行。所以是不是应该改成:
$this->_trans_depth += 1;
// When transactions are nested we only begin/commit/rollback the outermost ones
if ($this->_trans_depth > 1)
{
return;
}
$this->trans_begin($test_mode);
同样trans_complete() 也要做相应修改。
|
|