Thursday, November 29, 2012

AutoCommit enabled in MySQL DB

In MySQL default engine is set to "MyISAM". In  "MyISAM" engine, auto commit doesn't work. That means, you can't change commit time in application level. And, you can't roll back connections when needed when using "MyISAM" engine.

If you need to set auto commit enabled/ disabled in application level change MySQL DB engine to "INNODB" engine. In "INNODB" engine, you can roll back connection as needed.

CREATE TABLE Test1 (
  refNo varchar(10) default NULL,
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE Test1 (
  refNo varchar(10) default NULL,
) ENGINE=INNODB DEFAULT CHARSET=latin1;