Official Document Description :
Http://dev.mysql.com/doc/refman/5.5/en/commit.html
1.autocommit only available for InnoDb Data Sheet ;
2. the default is automatic submission , can be queried by the statement : SELECT @ @autocommit;
3.SET autocommit Disable or enable the default current session auto-commit mode ( Note : Only the current session is in effect );
4. Syntax : SET autocommit = {0 | 1} 0 disable autocommit for the current session , 1 enable auto-commit for the current session
5. can be modified by starting the service plus the command mode , see : http://dev.mysql.com/doc/ Refman/5.5/en/server-system-variables.html
Sample Code :
SELECT @ @autocommit; SET autocommit = 0;insert into T_patient (id,name) VALUES (1, ' 31 '); COMMIT; SELECT @ @autocommit; INSERT into T_patient (id,name) VALUES (2, ' 32 ');--rollback operation rollback;--Only one record select Id,name from T_ patient;--the current session to be committed, or the current session of the table t_patient will be locked commit;
This article is from my Tech blog blog, so be sure to keep this source http://programmer.blog.51cto.com/2859493/1880303
MySQL INNODB Data Sheet Automatic Submission Summary