<?php
class testControl extends skymvc{
	
	public function __construct(){
		parent::__construct();
	}

	public function onDefault(){
		phpinfo(); 
	}
	public function onBegin(){
		
		M("article")->begin();
		$id=M("article")->insert(array(
			"title"=>"测试事务"
		));
		M("article")->begin();
		$id=M("article")->insert(array(
			"title"=>"测试事务"
		));
		exit();
		
		
		//M("article")->rollback();
		$id=M("article")->insert(array(
			"title"=>"测试事务"
		));
		M("article")->commit();
		echo "插入完成".$id;
	}
	public function onBegin2(){
		 
		$id=M("article")->insert(array(
			"title"=>"测试事务"
		));
		echo "插入完成".$id;
	}
}

?>