mysql> desc t1;
+-------+-------------+------+-----+---------+----------------+
| Field | Type        | Null | Key | Default | Extra          |
+-------+-------------+------+-----+---------+----------------+
| i1    | int(11)     | NO   | PRI | NULL    | auto_increment |
| v2    | varchar(40) | NO   |     | NULL    |                |
+-------+-------------+------+-----+---------+----------------+delimiter $
create procedure test_insert_commit(v_max int)
begin
	declare v_id int default 0;
	repeat
		set v_id = v_id + 1;
		insert into t1 values(v_id, v_id);
		if (mod(v_id,10000) = 0) then commit;
		end if;
	until v_id >= v_max
	end repeat;
end$
delimiter ;디비를 실행해서 비어있는 t1 테이블에 위와 같은 쿼리를 만든다.
그리고
mysql> set autocommit=0;
mysql> call test_insert_commit(500000);이라고 입력하고
insert문이 반복되고 있는동안
디비를 강제종료해본다.
디비를 다시켜서 
select count(*) from t1이라고 해본다.
컴퓨터 사양에 따라서 1만건 단위로 커밋되어있는 것을 확인할수있다.
출처: 데이터베이스 첫걸음 p261